From 3019609a17e284148b51cf9c08a9fafa1e9dcd3f Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Thu, 11 Jan 2024 13:39:19 -0500 Subject: [PATCH] Allow forced redirects for everyone --- readthedocs/api/v3/serializers.py | 2 -- readthedocs/projects/forms.py | 11 ++++------- readthedocs/projects/models.py | 5 ----- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/readthedocs/api/v3/serializers.py b/readthedocs/api/v3/serializers.py index 21b1c30eced..ffa742a870b 100644 --- a/readthedocs/api/v3/serializers.py +++ b/readthedocs/api/v3/serializers.py @@ -944,8 +944,6 @@ class Meta: "position", "_links", ] - # TODO: allow editing this field for projects that have this feature enabled. - read_only_fields = ["force"] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/readthedocs/projects/forms.py b/readthedocs/projects/forms.py index e5051dc7a71..2653fecc834 100644 --- a/readthedocs/projects/forms.py +++ b/readthedocs/projects/forms.py @@ -785,13 +785,10 @@ def __init__(self, *args, **kwargs): self.fields["enabled"].widget = forms.CheckboxInput() self.fields["enabled"].empty_value = False - if self.project.has_feature(Feature.ALLOW_FORCED_REDIRECTS): - # Remove the nullable option from the form. - # TODO: remove after migration. - self.fields["force"].widget = forms.CheckboxInput() - self.fields["force"].empty_value = False - else: - self.fields.pop("force") + # Remove the nullable option from the form. + # TODO: remove after migration. + self.fields["force"].widget = forms.CheckboxInput() + self.fields["force"].empty_value = False def clean_project(self): return self.project diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 5dea927ed40..5b06c535444 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1951,7 +1951,6 @@ def add_features(sender, **kwargs): CONDA_APPEND_CORE_REQUIREMENTS = "conda_append_core_requirements" ALL_VERSIONS_IN_HTML_CONTEXT = "all_versions_in_html_context" RECORD_404_PAGE_VIEWS = "record_404_page_views" - ALLOW_FORCED_REDIRECTS = "allow_forced_redirects" DISABLE_PAGEVIEWS = "disable_pageviews" RESOLVE_PROJECT_FROM_HEADER = "resolve_project_from_header" USE_PROXIED_APIS_WITH_PREFIX = "use_proxied_apis_with_prefix" @@ -2020,10 +2019,6 @@ def add_features(sender, **kwargs): RECORD_404_PAGE_VIEWS, _("Proxito: Record 404s page views."), ), - ( - ALLOW_FORCED_REDIRECTS, - _("Proxito: Allow forced redirects."), - ), ( DISABLE_PAGEVIEWS, _("Proxito: Disable all page views"),