Skip to content

Commit bd4c82b

Browse files
authored
Merge pull request #4752 from rtfd/humitos/domain/extend-form
Allow to extend the DomainForm from outside
2 parents 8c7e18d + 6e22661 commit bd4c82b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

readthedocs/projects/forms.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def save(self, **_): # pylint: disable=arguments-differ
626626
return redirect
627627

628628

629-
class DomainForm(forms.ModelForm):
629+
class DomainBaseForm(forms.ModelForm):
630630

631631
"""Form to configure a custom domain name for a project."""
632632

@@ -638,7 +638,7 @@ class Meta(object):
638638

639639
def __init__(self, *args, **kwargs):
640640
self.project = kwargs.pop('project', None)
641-
super(DomainForm, self).__init__(*args, **kwargs)
641+
super(DomainBaseForm, self).__init__(*args, **kwargs)
642642

643643
def clean_project(self):
644644
return self.project
@@ -662,6 +662,10 @@ def clean_canonical(self):
662662
return canonical
663663

664664

665+
class DomainForm(SettingsOverrideObject):
666+
_default_class = DomainBaseForm
667+
668+
665669
class IntegrationForm(forms.ModelForm):
666670

667671
"""

0 commit comments

Comments
 (0)