mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
migrations: Fix zulipinternal migration corner case.
It's theoretically possible to have configured a Zulip server where the system bots live in the same realm as normal users (and may have in fact been the default in early Zulip releases? Unclear.). We should handle these without the migration intended to clean up naming for the system bot realm crashing. Fixes #13660.
This commit is contained in:
@@ -18,6 +18,10 @@ def rename_zulip_realm_to_zulipinternal(apps: StateApps, schema_editor: Database
|
||||
|
||||
if Realm.objects.filter(string_id="zulipinternal").exists():
|
||||
return
|
||||
if not Realm.objects.filter(string_id="zulip").exists():
|
||||
# If the user renamed the `zulip` system bot realm (or deleted
|
||||
# it), there's nothing for us to do.
|
||||
return
|
||||
|
||||
internal_realm = Realm.objects.get(string_id="zulip")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user