mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
typing: Use BaseDatabaseSchemaEditor in place of DatabaseSchemaEditor.
This is a part of #18777. Signed-off-by: Zixuan James Li <359101898@qq.com>
This commit is contained in:
committed by
Tim Abbott
parent
63e9ae8389
commit
d5517932cd
@@ -2,13 +2,13 @@
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
|
||||
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
|
||||
from django.db.migrations.state import StateApps
|
||||
from django.utils.timezone import now as timezone_now
|
||||
|
||||
|
||||
def backfill_user_activations_and_deactivations(
|
||||
apps: StateApps, schema_editor: DatabaseSchemaEditor
|
||||
apps: StateApps, schema_editor: BaseDatabaseSchemaEditor
|
||||
) -> None:
|
||||
migration_time = timezone_now()
|
||||
RealmAuditLog = apps.get_model("zerver", "RealmAuditLog")
|
||||
@@ -33,7 +33,7 @@ def backfill_user_activations_and_deactivations(
|
||||
)
|
||||
|
||||
|
||||
def reverse_code(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
|
||||
def reverse_code(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
|
||||
RealmAuditLog = apps.get_model("zerver", "RealmAuditLog")
|
||||
RealmAuditLog.objects.filter(event_type="user_created").delete()
|
||||
RealmAuditLog.objects.filter(event_type="user_deactivated").delete()
|
||||
|
||||
Reference in New Issue
Block a user