Skip to content

Redirects: remove unused status field #11079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions readthedocs/redirects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@

@admin.register(Redirect)
class RedirectAdmin(admin.ModelAdmin):
list_display = ["project", "redirect_type", "from_url", "to_url", "status"]
list_display = [
"project",
"redirect_type",
"from_url",
"to_url",
"position",
"enabled",
]
list_select_related = ("project",)
list_filter = ("redirect_type", "status")
list_filter = ("redirect_type", "enabled")
raw_id_fields = ("project",)
search_fields = (
"project__slug",
Expand Down
16 changes: 16 additions & 0 deletions readthedocs/redirects/migrations/0009_remove_status_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.2.9 on 2024-01-30 16:33

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("redirects", "0008_alter_redirect_position"),
]

operations = [
migrations.RemoveField(
model_name="redirect",
name="status",
),
]
3 changes: 0 additions & 3 deletions readthedocs/redirects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ class Redirect(models.Model):
help_text=_("Order of execution of the redirect."),
)

# TODO: remove this field and use `enabled` instead.
status = models.BooleanField(choices=[], default=True, null=True)

create_dt = models.DateTimeField(auto_now_add=True)
update_dt = models.DateTimeField(auto_now=True)

Expand Down