File tree 2 files changed +7
-5
lines changed 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -495,12 +495,10 @@ def save(self):
495
495
return self .project
496
496
497
497
498
- class WebHookForm (forms .Form ):
498
+ class WebHookForm (forms .ModelForm ):
499
499
500
500
"""Project webhook form."""
501
501
502
- url = forms .URLField ()
503
-
504
502
def __init__ (self , * args , ** kwargs ):
505
503
self .project = kwargs .pop ('project' , None )
506
504
super (WebHookForm , self ).__init__ (* args , ** kwargs )
@@ -510,10 +508,14 @@ def clean_url(self):
510
508
url = self .cleaned_data ['url' ], project = self .project )[0 ]
511
509
return self .webhook
512
510
513
- def save (self ):
511
+ def save (self , commit = True ):
514
512
self .project .webhook_notifications .add (self .webhook )
515
513
return self .project
516
514
515
+ class Meta :
516
+ model = WebHook
517
+ fields = ['url' ]
518
+
517
519
518
520
class TranslationBaseForm (forms .Form ):
519
521
Original file line number Diff line number Diff line change @@ -958,7 +958,7 @@ def __str__(self):
958
958
959
959
@python_2_unicode_compatible
960
960
class WebHook (Notification ):
961
- url = models .URLField (blank = True ,
961
+ url = models .URLField (max_length = 600 , blank = True ,
962
962
help_text = _ ('URL to send the webhook to' ))
963
963
964
964
def __str__ (self ):
You can’t perform that action at this time.
0 commit comments