From 53bf5883b19460f4a81d360d84e7eec4e1d0aca0 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 27 Feb 2024 19:57:03 +0100 Subject: [PATCH] Admin: remove temporal opt-out email settings Closes #11163 --- readthedocs/core/forms.py | 13 +------- .../migrations/0015_remove_email_options.py | 31 +++++++++++++++++++ readthedocs/core/models.py | 16 ---------- 3 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 readthedocs/core/migrations/0015_remove_email_options.py diff --git a/readthedocs/core/forms.py b/readthedocs/core/forms.py index 1e0aeeee433..a741d8edee2 100644 --- a/readthedocs/core/forms.py +++ b/readthedocs/core/forms.py @@ -24,14 +24,7 @@ class Meta: model = UserProfile # Don't allow users edit someone else's user page profile_fields = ["first_name", "last_name", "homepage"] - optout_email_fields = [ - "optout_email_config_file_deprecation", - "optout_email_build_image_deprecation", - ] - fields = ( - *profile_fields, - *optout_email_fields, - ) + fields = (*profile_fields,) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -47,10 +40,6 @@ def __init__(self, *args, **kwargs): _("User settings"), *self.Meta.profile_fields, ), - Fieldset( - _("Email settings"), - *self.Meta.optout_email_fields, - ), ] self.helper.layout = Layout(*field_sets) self.helper.add_input(Submit("save", _("Save"))) diff --git a/readthedocs/core/migrations/0015_remove_email_options.py b/readthedocs/core/migrations/0015_remove_email_options.py new file mode 100644 index 00000000000..f3160a3f70c --- /dev/null +++ b/readthedocs/core/migrations/0015_remove_email_options.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.10 on 2024-02-27 18:55 + +from django.db import migrations +from django_safemigrate import Safe + + +class Migration(migrations.Migration): + safe = Safe.after_deploy + + dependencies = [ + ("core", "0014_optout_email_build_image_deprecation"), + ] + + operations = [ + migrations.RemoveField( + model_name="historicaluserprofile", + name="optout_email_build_image_deprecation", + ), + migrations.RemoveField( + model_name="historicaluserprofile", + name="optout_email_config_file_deprecation", + ), + migrations.RemoveField( + model_name="userprofile", + name="optout_email_build_image_deprecation", + ), + migrations.RemoveField( + model_name="userprofile", + name="optout_email_config_file_deprecation", + ), + ] diff --git a/readthedocs/core/models.py b/readthedocs/core/models.py index 3ad3777ea01..5cab8ae43f1 100644 --- a/readthedocs/core/models.py +++ b/readthedocs/core/models.py @@ -43,22 +43,6 @@ class UserProfile(TimeStampedModel): whitelisted = models.BooleanField(_("Whitelisted"), default=False) banned = models.BooleanField(_("Banned"), default=False) - # Opt-out on emails - # NOTE: this is a temporary field that we can remove after September 25, 2023 - # See https://blog.readthedocs.com/migrate-configuration-v2/ - optout_email_config_file_deprecation = models.BooleanField( - _("Opt-out from email about 'Config file deprecation'"), - default=False, - null=True, - ) - # NOTE: this is a temporary field that we can remove after October 16, 2023 - # See https://blog.readthedocs.com/use-build-os-config/ - optout_email_build_image_deprecation = models.BooleanField( - _("Opt-out from email about '\"build.image\" config key deprecation'"), - default=False, - null=True, - ) - # Model history history = ExtraHistoricalRecords()