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:
Anders Kaseorg 2023-01-17 23:56:37 -05:00 committed by Tim Abbott
parent f38b5c41da
commit 9a7f33ab98
1 changed files with 3 additions and 2 deletions

View File

@ -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):