Set URL label properly
This commit is contained in:
parent
af5c212450
commit
2c12854a55
|
@ -71,6 +71,10 @@ class CustomUserCreationForm(UserCreationForm):
|
||||||
|
|
||||||
|
|
||||||
class NotificationSettingsForm(RestrictedFormMixin, ModelForm):
|
class NotificationSettingsForm(RestrictedFormMixin, ModelForm):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(NotificationSettingsForm, self).__init__(*args, **kwargs)
|
||||||
|
self.fields["url"].label = "URL"
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = NotificationSettings
|
model = NotificationSettings
|
||||||
fields = (
|
fields = (
|
||||||
|
@ -96,6 +100,10 @@ class NotificationSettingsForm(RestrictedFormMixin, ModelForm):
|
||||||
|
|
||||||
|
|
||||||
class NotificationRuleForm(RestrictedFormMixin, ModelForm):
|
class NotificationRuleForm(RestrictedFormMixin, ModelForm):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(NotificationRuleForm, self).__init__(*args, **kwargs)
|
||||||
|
self.fields["url"].label = "URL"
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = NotificationRule
|
model = NotificationRule
|
||||||
fields = (
|
fields = (
|
||||||
|
@ -127,6 +135,8 @@ class NotificationRuleForm(RestrictedFormMixin, ModelForm):
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
cleaned_data = super(NotificationRuleForm, self).clean()
|
cleaned_data = super(NotificationRuleForm, self).clean()
|
||||||
|
|
||||||
|
# TODO: should this be in rules.py?
|
||||||
if "service" in cleaned_data:
|
if "service" in cleaned_data:
|
||||||
if cleaned_data["service"] == "webhook":
|
if cleaned_data["service"] == "webhook":
|
||||||
if not cleaned_data.get("url"):
|
if not cleaned_data.get("url"):
|
||||||
|
|
Loading…
Reference in New Issue