Skip to content

Commit

Permalink
Allow forced redirects for everyone
Browse files Browse the repository at this point in the history
  • Loading branch information
stsewd committed Jan 11, 2024
1 parent 9344a28 commit 3019609
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 0 additions & 2 deletions readthedocs/api/v3/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions readthedocs/projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit 3019609

Please sign in to comment.