Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
emoji: Switch users with blob emoji to use Google style.
evykassirer6a90a4b27c31
diff --git a/zerver/migrations/0416_set_default_emoji_style.py b/zerver/migrations/0416_set_default_emoji_style.pynew file mode 100644index 00000000000..9a43a5ab25c--- /dev/null+++ b/zerver/migrations/0416_set_default_emoji_style.py@@ -0,0 +1,30 @@+from django.db import migrations+from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor+from django.db.migrations.state import StateApps+++def update_deprecated_emoji_style(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:+ """+ This migration updates the emoji style for users who are using the+ deprecated Google blob style. Unless they are part of an organization+ which has Google blob as an organization default, these users will+ now use the modern Google emoji style.+ """++ UserProfile = apps.get_model("zerver", "UserProfile")+ RealmUserDefault = apps.get_model("zerver", "RealmUserDefault")++ UserProfile.objects.filter(emojiset="google-blob").exclude(+ realm__in=RealmUserDefault.objects.filter(emojiset="google-blob").values("realm")+ ).update(emojiset="google")+++class Migration(migrations.Migration):++ dependencies = [+ ("zerver", "0415_delete_scimclient"),+ ]++ operations = [+ migrations.RunPython(update_deprecated_emoji_style, elidable=True),+ ]