Skip to content

Commit

Permalink
Merge pull request #4752 from rtfd/humitos/domain/extend-form
Browse files Browse the repository at this point in the history
Allow to extend the DomainForm from outside
  • Loading branch information
humitos authored Oct 15, 2018
2 parents 8c7e18d + 6e22661 commit bd4c82b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions readthedocs/projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def save(self, **_): # pylint: disable=arguments-differ
return redirect


class DomainForm(forms.ModelForm):
class DomainBaseForm(forms.ModelForm):

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

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

def __init__(self, *args, **kwargs):
self.project = kwargs.pop('project', None)
super(DomainForm, self).__init__(*args, **kwargs)
super(DomainBaseForm, self).__init__(*args, **kwargs)

def clean_project(self):
return self.project
Expand All @@ -662,6 +662,10 @@ def clean_canonical(self):
return canonical


class DomainForm(SettingsOverrideObject):
_default_class = DomainBaseForm


class IntegrationForm(forms.ModelForm):

"""
Expand Down

0 comments on commit bd4c82b

Please sign in to comment.