Skip to content

Commit d7f4c94

Browse files
authored
Redirects: remove unused status field (#11079)
* Redirects: remove unused status field * Format
1 parent b1195c7 commit d7f4c94

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

readthedocs/redirects/admin.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@
77

88
@admin.register(Redirect)
99
class RedirectAdmin(admin.ModelAdmin):
10-
list_display = ["project", "redirect_type", "from_url", "to_url", "status"]
10+
list_display = [
11+
"project",
12+
"redirect_type",
13+
"from_url",
14+
"to_url",
15+
"position",
16+
"enabled",
17+
]
1118
list_select_related = ("project",)
12-
list_filter = ("redirect_type", "status")
19+
list_filter = ("redirect_type", "enabled")
1320
raw_id_fields = ("project",)
1421
search_fields = (
1522
"project__slug",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated by Django 4.2.9 on 2024-01-30 16:33
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("redirects", "0008_alter_redirect_position"),
9+
]
10+
11+
operations = [
12+
migrations.RemoveField(
13+
model_name="redirect",
14+
name="status",
15+
),
16+
]

readthedocs/redirects/models.py

-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ class Redirect(models.Model):
116116
help_text=_("Order of execution of the redirect."),
117117
)
118118

119-
# TODO: remove this field and use `enabled` instead.
120-
status = models.BooleanField(choices=[], default=True, null=True)
121-
122119
create_dt = models.DateTimeField(auto_now_add=True)
123120
update_dt = models.DateTimeField(auto_now=True)
124121

0 commit comments

Comments
 (0)