Repository navigation
Pass the paginator its count instead of patching the queryset - #1665
Conversation
qs_with_hardcoded_count replaced a queryset's count method with a lambda, which any clone, such as the paginator's own order_by, silently dropped, and the lesion list set a custom_count attribute with the same problem. paginate and paginate_queryset take the total as a count argument instead. A given count is returned on every page, as the lesion list already did, while queryset.count() still only runs on the first.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
qs_with_hardcoded_countreplaced a queryset'scountmethod with a lambda, which any clone, such as the paginator's ownorder_by, silently dropped, and the lesion list set acustom_countattribute with the same problem.paginateandpaginate_querysettake the total as acountargument instead.queryset.count()still only runs on the first page.Independent of the permissions change that removes the
distinct()calls these endpoints still carry.Summary by CodeRabbit