Skip to content

Commit cba5452

Browse files
chirathrericholscher
authored andcommitted
Increase Webhook notification URL max_length to 600
1 parent ab78b3a commit cba5452

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

readthedocs/projects/forms.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,10 @@ def save(self):
530530
return self.project
531531

532532

533-
class WebHookForm(forms.Form):
533+
class WebHookForm(forms.ModelForm):
534534

535535
"""Project webhook form."""
536536

537-
url = forms.URLField()
538-
539537
def __init__(self, *args, **kwargs):
540538
self.project = kwargs.pop('project', None)
541539
super(WebHookForm, self).__init__(*args, **kwargs)
@@ -545,10 +543,14 @@ def clean_url(self):
545543
url=self.cleaned_data['url'], project=self.project)[0]
546544
return self.webhook
547545

548-
def save(self):
546+
def save(self, commit=True):
549547
self.project.webhook_notifications.add(self.webhook)
550548
return self.project
551549

550+
class Meta:
551+
model = WebHook
552+
fields = ['url']
553+
552554

553555
class TranslationBaseForm(forms.Form):
554556

readthedocs/projects/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ def __str__(self):
971971

972972
@python_2_unicode_compatible
973973
class WebHook(Notification):
974-
url = models.URLField(blank=True,
974+
url = models.URLField(max_length=600, blank=True,
975975
help_text=_('URL to send the webhook to'))
976976

977977
def __str__(self):

0 commit comments

Comments
 (0)