mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
This is a preparatory commit for using isort for sorting all of our imports, merging changes to files where we can easily review the changes as something we're happy with. These are also files with relatively little active development, which means we don't expect much merge conflict risk from these changes.
25 lines
742 B
Python
25 lines
742 B
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.11.4 on 2017-08-30 00:26
|
|
from django.db import migrations
|
|
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
|
|
from django.db.migrations.state import StateApps
|
|
|
|
from zerver.lib.fix_unreads import fix
|
|
|
|
|
|
def fix_unreads(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> 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),
|
|
]
|