Make LocalSite filtering in HostingServiceAccountManager conditional.
Review Request #12398 — Created June 22, 2022 and submitted
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.
| Summary | ID |
|---|---|
| d650e557b6de1853966bca3ca0edc62147171150 |
| Description | From | Last Updated |
|---|---|---|
|
'djblets.testing.decorators.add_fixtures' imported but unused Column: 1 Error code: F401 |
|
|
|
local variable 'account2' is assigned to but never used Column: 9 Error code: F841 |
|
|
|
local variable 'account3' is assigned to but never used Column: 9 Error code: F841 |
|
|
|
local variable 'account4' is assigned to but never used Column: 9 Error code: F841 |
|