Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
migrations: Fix revert migration to not lose all preferences.
Alex Vandiver8b0cecc7e418
diff --git a/zerver/migrations/0490_renumber_options_desktop_icon_count_display.py b/zerver/migrations/0490_renumber_options_desktop_icon_count_display.pyindex 868bde1f172..cda6881b122 100644--- a/zerver/migrations/0490_renumber_options_desktop_icon_count_display.py+++ b/zerver/migrations/0490_renumber_options_desktop_icon_count_display.py@@ -39,13 +39,6 @@ def reverse_code(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> NoRealmUserDefault = apps.get_model("zerver", "RealmUserDefault")UserProfile = apps.get_model("zerver", "UserProfile")- UserProfile.objects.filter(- desktop_icon_count_display=NEW_DESKTOP_ICON_COUNT_DISPLAY_NONE- ).update(desktop_icon_count_display=OLD_DESKTOP_ICON_COUNT_DISPLAY_NONE)- RealmUserDefault.objects.filter(- desktop_icon_count_display=NEW_DESKTOP_ICON_COUNT_DISPLAY_NONE- ).update(desktop_icon_count_display=OLD_DESKTOP_ICON_COUNT_DISPLAY_NONE)-UserProfile.objects.filter(desktop_icon_count_display=NEW_DESKTOP_ICON_COUNT_DISPLAY_DM_MENTION).update(desktop_icon_count_display=OLD_DESKTOP_ICON_COUNT_DISPLAY_DM_MENTION)@@ -53,6 +46,13 @@ def reverse_code(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> Nodesktop_icon_count_display=NEW_DESKTOP_ICON_COUNT_DISPLAY_DM_MENTION).update(desktop_icon_count_display=OLD_DESKTOP_ICON_COUNT_DISPLAY_DM_MENTION)+ UserProfile.objects.filter(+ desktop_icon_count_display=NEW_DESKTOP_ICON_COUNT_DISPLAY_NONE+ ).update(desktop_icon_count_display=OLD_DESKTOP_ICON_COUNT_DISPLAY_NONE)+ RealmUserDefault.objects.filter(+ desktop_icon_count_display=NEW_DESKTOP_ICON_COUNT_DISPLAY_NONE+ ).update(desktop_icon_count_display=OLD_DESKTOP_ICON_COUNT_DISPLAY_NONE)+class Migration(migrations.Migration):dependencies = [