zilencer: Avoid using stale last_audit_log_update.

This commit is contained in:
Tim Abbott 2023-12-14 08:59:15 -08:00
parent e02e0cd37e
commit 036b1156f2
1 changed files with 2 additions and 3 deletions

View File

@ -976,9 +976,8 @@ def remote_server_post_analytics(
# We need to update 'last_audit_log_update' before calling the
# 'sync_license_ledger_if_needed' method to avoid 'MissingDataError'
# due to 'has_stale_audit_log' being True.
RemoteZulipServer.objects.filter(uuid=server.uuid).update(
last_audit_log_update=timezone_now()
)
server.last_audit_log_update = timezone_now()
server.save(update_fields=["last_audit_log_update"])
# Update LicenseLedger for remote_realm customers using logs in RemoteRealmAuditlog.
for remote_realm in remote_realms_set: