File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -530,12 +530,10 @@ def save(self):
530
530
return self .project
531
531
532
532
533
- class WebHookForm (forms .Form ):
533
+ class WebHookForm (forms .ModelForm ):
534
534
535
535
"""Project webhook form."""
536
536
537
- url = forms .URLField ()
538
-
539
537
def __init__ (self , * args , ** kwargs ):
540
538
self .project = kwargs .pop ('project' , None )
541
539
super (WebHookForm , self ).__init__ (* args , ** kwargs )
@@ -545,10 +543,14 @@ def clean_url(self):
545
543
url = self .cleaned_data ['url' ], project = self .project )[0 ]
546
544
return self .webhook
547
545
548
- def save (self ):
546
+ def save (self , commit = True ):
549
547
self .project .webhook_notifications .add (self .webhook )
550
548
return self .project
551
549
550
+ class Meta :
551
+ model = WebHook
552
+ fields = ['url' ]
553
+
552
554
553
555
class TranslationBaseForm (forms .Form ):
554
556
Original file line number Diff line number Diff line change @@ -971,7 +971,7 @@ def __str__(self):
971
971
972
972
@python_2_unicode_compatible
973
973
class WebHook (Notification ):
974
- url = models .URLField (blank = True ,
974
+ url = models .URLField (max_length = 600 , blank = True ,
975
975
help_text = _ ('URL to send the webhook to' ))
976
976
977
977
def __str__ (self ):
You can’t perform that action at this time.
0 commit comments