Files
zulip/zerver/migrations/0126_prereg_remove_users_without_realm.py
Anders Kaseorg c734bbd95d python: Modernize legacy Python 2 syntax with pyupgrade.
Generated by `pyupgrade --py3-plus --keep-percent-format` on all our
Python code except `zthumbor` and `zulip-ec2-configure-interfaces`,
followed by manual indentation fixes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-09 16:43:22 -07:00

23 lines
739 B
Python

# Generated by Django 1.11.6 on 2017-11-30 04:58
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def remove_prereg_users_without_realm(
apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
prereg_model = apps.get_model("zerver", "PreregistrationUser")
prereg_model.objects.filter(realm=None, realm_creation=False).delete()
class Migration(migrations.Migration):
dependencies = [
('zerver', '0125_realm_max_invites'),
]
operations = [
migrations.RunPython(remove_prereg_users_without_realm,
reverse_code=migrations.RunPython.noop),
]