import_realm: Move push bouncer ping after realm reactivation.

This commit is contained in:
Tim Abbott
2023-12-03 23:05:13 -08:00
parent f6c7eaf1e5
commit fbd8ed1425

View File

@@ -1023,8 +1023,6 @@ def do_import_realm(import_dir: Path, subdomain: str, processes: int = 1) -> Rea
if "zerver_usergroup" not in data:
set_default_for_realm_permission_group_settings(realm)
enqueue_register_realm_with_push_bouncer_if_needed(realm)
# Remap the user IDs for notification_bot and friends to their
# appropriate IDs on this server
internal_realm = get_realm(settings.SYSTEM_BOT_REALM)
@@ -1423,6 +1421,11 @@ def do_import_realm(import_dir: Path, subdomain: str, processes: int = 1) -> Rea
realm.deactivated = data["zerver_realm"][0]["deactivated"]
realm.save()
# Ask the push notifications service if this realm can send
# notifications, if we're using it. Needs to happen after the
# Realm object is reactivated.
enqueue_register_realm_with_push_bouncer_if_needed(realm)
return realm