Skip to content

Commit

Permalink
Admin: remove temporal opt-out email settings
Browse files Browse the repository at this point in the history
Closes #11163
  • Loading branch information
humitos committed Feb 27, 2024
1 parent 90e2d48 commit 53bf588
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
13 changes: 1 addition & 12 deletions readthedocs/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")))
Expand Down
31 changes: 31 additions & 0 deletions readthedocs/core/migrations/0015_remove_email_options.py
Original file line number Diff line number Diff line change
@@ -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",
),
]
16 changes: 0 additions & 16 deletions readthedocs/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 53bf588

Please sign in to comment.