mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +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.
27 lines
957 B
Python
27 lines
957 B
Python
# -*- coding: utf-8 -*-
|
|
from django.db import migrations, models
|
|
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
|
|
from django.db.migrations.state import StateApps
|
|
|
|
|
|
def change_emojiset_choice(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
|
|
UserProfile = apps.get_model('zerver', 'UserProfile')
|
|
UserProfile.objects.exclude(emojiset__in=['google', 'text']).update(emojiset='google')
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('zerver', '0180_usermessage_add_active_mobile_push_notification'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(
|
|
change_emojiset_choice,
|
|
reverse_code=migrations.RunPython.noop),
|
|
migrations.AlterField(
|
|
model_name='userprofile',
|
|
name='emojiset',
|
|
field=models.CharField(choices=[('google', 'Google'), ('text', 'Plain text')], default='google', max_length=20),
|
|
),
|
|
]
|