-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix permissioned pagination #480
Fix permissioned pagination #480
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Type: Bug fix
PR Summary: This pull request addresses a TypeError encountered when applying permission checks on a paginated queryset using the HasRetvalPerm extension. The core of the fix involves modifying the order in which filter_with_perms
is applied in relation to super().get_queryset
, aiming to resolve the issue without breaking existing functionality. Additionally, the PR extends test coverage to include scenarios that validate the correct behavior of permissioned pagination.
Decision: Comment
📝 Type: 'Bug fix' - not supported yet.
- Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.
General suggestions:
- Ensure comprehensive testing around the modified order of
filter_with_perms
andsuper().get_queryset
to catch any potential edge cases that could arise from this change. - Consider adding more detailed comments in the code changes to explain the reasoning behind the order modification for future maintainers.
- Review the new test cases added for paginated queries with permissions to ensure they cover a wide range of scenarios, including edge cases not immediately apparent.
Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
=======================================
Coverage 87.90% 87.90%
=======================================
Files 37 37
Lines 3167 3167
=======================================
Hits 2784 2784
Misses 383 383 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! :)
Fixes an error when trying to apply permission checks using the
HasRetvalPerm
extension on a paginated list.Types of Changes
Issues Fixed or Closed by This PR
Fix #471
Checklist