Files
zulip/zerver/migrations/0104_fix_unreads.py
Anders Kaseorg df001db1a9 black: Reformat with Black 23.
Black 23 enforces some slightly more specific rules about empty line
counts and redundant parenthesis removal, but the result is still
compatible with Black 22.

(This does not actually upgrade our Python environment to Black 23
yet.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-02 10:40:13 -08:00

24 lines
732 B
Python

# Generated by Django 1.11.4 on 2017-08-30 00:26
from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
from zerver.lib.fix_unreads import fix
def fix_unreads(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
user_profiles = list(UserProfile.objects.filter(is_bot=False))
for user_profile in user_profiles:
fix(user_profile)
class Migration(migrations.Migration):
dependencies = [
("zerver", "0103_remove_userprofile_muted_topics"),
]
operations = [
migrations.RunPython(fix_unreads, elidable=True),
]