mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-25 08:41:51 +00:00
make robust against None value
This commit is contained in:
parent
41e64a217c
commit
ddf88d5394
@ -218,8 +218,9 @@ class EntranceForm(ModelForm):
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
if self.cleaned_data.get("url").startswith("/"):
|
||||
self._errors["url"] = self.error_class(["This field cannot start with a /."])
|
||||
if self.cleaned_data.get("url"):
|
||||
if self.cleaned_data.get("url").startswith("/"):
|
||||
self._errors["url"] = self.error_class(["This field cannot start with a /."])
|
||||
return self.cleaned_data
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user