Skip to content

Commit

Permalink
Redirects: remove unused status field (#11079)
Browse files Browse the repository at this point in the history
* Redirects: remove unused status field

* Format
  • Loading branch information
stsewd committed Jan 30, 2024
1 parent b1195c7 commit d7f4c94
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
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

0 comments on commit d7f4c94

Please sign in to comment.