Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(account): allow User.objects to use prefetch_related()
Django forbids QuerySet.iterator(chunk_size=None) on QuerySets that have QuerySet.prefetch_related(), some chunk_size must be specified. 2000 is the default chunk_size for when there is no prefetching. In my case, I am using custom UserManager for User.objects and I do use prefetch. Specifically I join price list information (including currency and VAT rate) for the user since that's used practically everywhere on the site and I want to avoid another unnecessary query as well as de-normalizing this information to all users. Reviewed-on: https://codeberg.org/allauth/django-allauth/pulls/4196 Co-authored-by: Jan Hamal Dvořák <[email protected]> Co-committed-by: Jan Hamal Dvořák <[email protected]>
- Loading branch information