feat(rpg): reveal found diamond list to diamond owner (fixes #307)#449
feat(rpg): reveal found diamond list to diamond owner (fixes #307)#449pi625 wants to merge 3 commits intovEnhance:mainfrom
Conversation
…#307) - Show 'found list' link on diamond solution page to the creator - Allow creator to access the FoundList view (previously staff-only)
Pull Request Test Coverage Report for Build 22127357045Details
💛 - Coveralls |
|
uh oh |
rpg/views.py
Outdated
| isinstance(self.request.user, User) | ||
| and self.request.user == achievement.creator | ||
| ): | ||
| return super(StaffRequiredMixin, self).dispatch(*args, **kwargs) |
vEnhance
left a comment
There was a problem hiding this comment.
There should be some unit tests to verify this does the correct thing.
I think some comment about why this would be desirable would also be helpful for context.
- Add test_found_list_creator_access to verify creators can see their diamond's found list - Fix dispatch method to properly check authentication before bypassing staff check - Add explanatory comments for the permission bypass logic
|
I added a unit test that passed and fixed dispatch logic to properly check authentication before bypassing staff check and commented a lot more. For the feature itself, I don't see it as significantly desirable or undesirable, just a quality of life type thing(and I wanted to practice coding in a way that wouldn't significantly affect anything/maybe be slightly beneficial). I added a main and edge case unit test and the code works with all other tests. happy to adjust further if needed! |
|
I have some slight elegance concerns about hijacking BTW, are you using an LLM to write this? It's fine if so, but it's useful for me to know because the kind of things I need to look for in a review are different from AI-generated code versus human-written code. (I should probably mention this in contributing guidelines.) |
(finished both)
If you're an OTIS student, include your OTIS-WEB username or student ID number
(whichever you prefer) so I can grant you the spades bounty as well.
Student ID: 3064