remote-support: Show remote realm matches if deactivated.

As a follow-up to commit d66b7ad853, where we send internal emails
when an active paid plan is on a locally deleted remote realm, we
need search queries in the remote support view to return results
for these deactivated remote realms, instead of excluding them.
This commit is contained in:
Lauryn Menard 2024-03-01 13:08:09 +01:00 committed by Tim Abbott
parent 7b1bb984b3
commit 26e305e27d
1 changed files with 4 additions and 8 deletions

View File

@ -490,11 +490,9 @@ def get_remote_servers_for_support(
if uuid_to_search: if uuid_to_search:
remote_servers_set = set(remote_servers_query.filter(uuid__iexact=uuid_to_search)) remote_servers_set = set(remote_servers_query.filter(uuid__iexact=uuid_to_search))
remote_realm_matches = ( remote_realm_matches = RemoteRealm.objects.filter(
RemoteRealm.objects.filter(uuid__iexact=uuid_to_search) uuid__iexact=uuid_to_search
.exclude(realm_deactivated=True) ).select_related("server")
.select_related("server")
)
for remote_realm in remote_realm_matches: for remote_realm in remote_realm_matches:
remote_servers_set.add(remote_realm.server) remote_servers_set.add(remote_realm.server)
return list(remote_servers_set) return list(remote_servers_set)
@ -504,9 +502,7 @@ def get_remote_servers_for_support(
remote_servers_query.filter(hostname__icontains=hostname_to_search) remote_servers_query.filter(hostname__icontains=hostname_to_search)
) )
remote_realm_matches = ( remote_realm_matches = (
RemoteRealm.objects.filter(host__icontains=hostname_to_search).exclude( RemoteRealm.objects.filter(host__icontains=hostname_to_search)
realm_deactivated=True
)
).select_related("server") ).select_related("server")
for remote_realm in remote_realm_matches: for remote_realm in remote_realm_matches:
remote_servers_set.add(remote_realm.server) remote_servers_set.add(remote_realm.server)