Skip to content

Commit 9c8fe6f

Browse files
authored
Redirects: remove null option from position field (#10991)
When creating a new redirect using the API, omitting the position field would result in a default of None instead of 0. Ref https://read-the-docs.sentry.io/issues/4802345808/?project=148442&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=24h&stream_index=0
1 parent 214255d commit 9c8fe6f

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 4.2.8 on 2024-01-03 20:13
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("redirects", "0007_migrate_to_new_syntax"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="redirect",
14+
name="position",
15+
field=models.PositiveIntegerField(
16+
default=0,
17+
help_text="Order of execution of the redirect.",
18+
verbose_name="Position",
19+
),
20+
),
21+
]

readthedocs/redirects/models.py

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ class Redirect(models.Model):
113113
position = models.PositiveIntegerField(
114114
_("Position"),
115115
default=0,
116-
null=True,
117116
help_text=_("Order of execution of the redirect."),
118117
)
119118

0 commit comments

Comments
 (0)