@@ -207,7 +207,7 @@ class Meta:
207
207
"single_version" ,
208
208
"external_builds_enabled" ,
209
209
"external_builds_privacy_level" ,
210
- "rtd_conf_file " ,
210
+ "build_config_file " ,
211
211
)
212
212
# These that can be set per-version using a config file.
213
213
per_version_settings = (
@@ -358,15 +358,8 @@ def clean_conf_py_file(self):
358
358
) # yapf: disable
359
359
return filename
360
360
361
- def clean_rtd_conf_file (self ):
362
- filename = self .cleaned_data .get ("rtd_conf_file" , "" ).strip ()
363
- if filename and ".readthedocs.yml" not in filename :
364
- raise forms .ValidationError (
365
- _ (
366
- "Your configuration file is invalid, make sure it contains "
367
- ".readthedocs.yml in it." ,
368
- ),
369
- ) # yapf: disable
361
+ def clean_build_config_file (self ):
362
+ filename = self .cleaned_data .get ("build_config_file" , "" ).strip ()
370
363
return filename
371
364
372
365
def get_all_active_versions (self ):
@@ -391,7 +384,9 @@ class UpdateProjectForm(
391
384
ProjectExtraForm ,
392
385
):
393
386
394
- class Meta :
387
+ """Basic project settings form for Admin."""
388
+
389
+ class Meta : # noqa
395
390
model = Project
396
391
fields = (
397
392
# Basics
@@ -407,6 +402,7 @@ class Meta:
407
402
)
408
403
409
404
def clean_language (self ):
405
+ """Ensure that language isn't already active."""
410
406
language = self .cleaned_data ['language' ]
411
407
project = self .instance
412
408
if project :
@@ -540,6 +536,8 @@ def save(self):
540
536
541
537
class WebHookForm (forms .ModelForm ):
542
538
539
+ """Webhook form."""
540
+
543
541
project = forms .CharField (widget = forms .HiddenInput (), required = False )
544
542
545
543
class Meta :
@@ -607,6 +605,8 @@ def get_choices(self):
607
605
) for project in self .get_translation_queryset ().all ()]
608
606
609
607
def clean_project (self ):
608
+ """Ensures that selected project is valid as a translation."""
609
+
610
610
translation_project_slug = self .cleaned_data ['project' ]
611
611
612
612
# Ensure parent project isn't already itself a translation
@@ -726,6 +726,7 @@ def clean_project(self):
726
726
return self .project
727
727
728
728
def clean_domain (self ):
729
+ """Validates domain."""
729
730
domain = self .cleaned_data ['domain' ].lower ()
730
731
parsed = urlparse (domain )
731
732
@@ -864,6 +865,7 @@ def clean_project(self):
864
865
return self .project
865
866
866
867
def clean_name (self ):
868
+ """Validate environment variable name chosen."""
867
869
name = self .cleaned_data ['name' ]
868
870
if name .startswith ('__' ):
869
871
raise forms .ValidationError (
0 commit comments