Make LocalSite filtering in HostingServiceAccountManager conditional.
Review Request #12398 — Created June 22, 2022 and submitted — Latest diff uploaded
HostingServiceAccount.objects.accessible()
no longer unconditionally
filters byLocalSite
. Most deployments don't use Local Site
functionality, making the addition of this filter unnecessarily
expensive in the common case.This change uses
LocalSite.objects.has_local_sites()
to determine
whether to include the filter.It also removes the
distinct()
call, which is really not necessary for
this query.
Unit tests pass.
Diff Revision 1
This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.
orig
1
2
Commits
reviewboard/hostingsvcs/managers.py |
---|
reviewboard/hostingsvcs/tests/test_hosting_service_account_manager.py |
---|