mirror of https://github.com/zulip/zulip.git
migrations: Fix ‘continue’ logic error in 0037.
The intention was to continue the outer ‘for’ loop, not the inner one (but Python doesn’t have labelled ‘continue’). Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
f38b5c41da
commit
9a7f33ab98
|
@ -19,10 +19,11 @@ def set_string_id_using_domain(apps: StateApps, schema_editor: BaseDatabaseSchem
|
|||
try:
|
||||
realm.string_id = prefix + str(i)
|
||||
realm.save(update_fields=["string_id"])
|
||||
continue
|
||||
break
|
||||
except IntegrityError:
|
||||
pass
|
||||
raise RuntimeError(f"Unable to find a good string_id for realm {realm}")
|
||||
else:
|
||||
raise RuntimeError(f"Unable to find a good string_id for realm {realm}")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
Loading…
Reference in New Issue