From 2bfbbf0035a0975c019752ed496c2a1156104e68 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 5 Oct 2023 16:10:05 -0700 Subject: [PATCH] migrations: Fix initial value for automatic policy migrations. Migration 0476 was incorrectly not updated for changes in the defaults -- we intended the "never" value. --- ...omatically_follow_topics_policy_and_more.py | 18 ++++++++++++++---- ...omatically_follow_topics_policy_and_more.py | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/zerver/migrations/0476_realmuserdefault_automatically_follow_topics_policy_and_more.py b/zerver/migrations/0476_realmuserdefault_automatically_follow_topics_policy_and_more.py index 7dc6406bc5..4f8952fef0 100644 --- a/zerver/migrations/0476_realmuserdefault_automatically_follow_topics_policy_and_more.py +++ b/zerver/migrations/0476_realmuserdefault_automatically_follow_topics_policy_and_more.py @@ -2,6 +2,8 @@ from django.db import migrations, models +AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER = 4 + class Migration(migrations.Migration): dependencies = [ @@ -12,21 +14,29 @@ class Migration(migrations.Migration): migrations.AddField( model_name="realmuserdefault", name="automatically_follow_topics_policy", - field=models.PositiveSmallIntegerField(default=3), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), migrations.AddField( model_name="realmuserdefault", name="automatically_unmute_topics_in_muted_streams_policy", - field=models.PositiveSmallIntegerField(default=3), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), migrations.AddField( model_name="userprofile", name="automatically_follow_topics_policy", - field=models.PositiveSmallIntegerField(default=3), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), migrations.AddField( model_name="userprofile", name="automatically_unmute_topics_in_muted_streams_policy", - field=models.PositiveSmallIntegerField(default=3), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), ] diff --git a/zerver/migrations/0477_alter_realmuserdefault_automatically_follow_topics_policy_and_more.py b/zerver/migrations/0477_alter_realmuserdefault_automatically_follow_topics_policy_and_more.py index da37d33174..7ad1fbe5f7 100644 --- a/zerver/migrations/0477_alter_realmuserdefault_automatically_follow_topics_policy_and_more.py +++ b/zerver/migrations/0477_alter_realmuserdefault_automatically_follow_topics_policy_and_more.py @@ -2,6 +2,8 @@ from django.db import migrations, models +AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER = 4 + class Migration(migrations.Migration): dependencies = [ @@ -12,21 +14,29 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="realmuserdefault", name="automatically_follow_topics_policy", - field=models.PositiveSmallIntegerField(default=4), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), migrations.AlterField( model_name="realmuserdefault", name="automatically_unmute_topics_in_muted_streams_policy", - field=models.PositiveSmallIntegerField(default=4), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), migrations.AlterField( model_name="userprofile", name="automatically_follow_topics_policy", - field=models.PositiveSmallIntegerField(default=4), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), migrations.AlterField( model_name="userprofile", name="automatically_unmute_topics_in_muted_streams_policy", - field=models.PositiveSmallIntegerField(default=4), + field=models.PositiveSmallIntegerField( + default=AUTOMATICALLY_CHANGE_VISIBILITY_POLICY_NEVER + ), ), ]