We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1efbb24 commit 86994c0Copy full SHA for 86994c0
downloads/models.py
@@ -146,6 +146,20 @@ def is_version_at_least_3_5(self):
146
def is_version_at_least_3_9(self):
147
return self.is_version_at_least((3, 9))
148
149
+ def clean(self):
150
+ super().clean()
151
+ if not re.match(r'^Python\s[\d.]+%', self.name):
152
+ raise ValidationError({
153
+ "name": "Release name must be in the format 'Python X.Y.Z' (e.g., 'Python 3.14.0')"
154
+ })
155
+
156
+ # def clean(self):
157
+ # super().clean()
158
+ # if not re.match(r'^Python\s[\d.]+$', self.name):
159
+ # raise ValidationError({
160
+ # 'name': 'Name must be in the format "Python X.Y.Z" (e.g., "Python 3.9.0")'
161
+ # })
162
163
164
def update_supernav():
165
latest_python3 = Release.objects.latest_python3()
0 commit comments