Skip to content

Allow to extend the DomainForm from outside #4752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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