zilencer: Fix can_push logging bug with system bot realms.

We could be incorrectly logging the can_push value associated with the
system bot realm when only a single human realm existed on a server.
This commit is contained in:
Tim Abbott 2023-12-17 09:28:27 -08:00
parent 24dc2e783d
commit 39936972f7
1 changed files with 5 additions and 2 deletions

View File

@ -1072,9 +1072,12 @@ def remote_server_post_analytics(
for remote_realm in remote_realms:
uuid = str(remote_realm.uuid)
status = get_push_status_for_remote_request(server, remote_realm)
if remote_human_realm_count == 1: # nocoverage
if remote_realm.is_system_bot_realm:
# Ignore system bot realms for computing log_data
pass
elif remote_human_realm_count == 1: # nocoverage
log_data["extra"] = f"[can_push={status.can_push}/{status.message}]"
elif not remote_realm.is_system_bot_realm:
else:
can_push_values.add(status.can_push)
remote_realm_dict[uuid] = {
"can_push": status.can_push,