2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 16:51:54 +00:00

Avoid barf if URL field in new cave form is left blank.

This commit is contained in:
Wookey 2018-02-28 15:57:27 +00:00
commit 0c2a6b49ba

View File

@ -29,7 +29,7 @@ class CaveForm(ModelForm):
self._errors["official_name"] = self.error_class(["This field is required when there is a kataster number."]) self._errors["official_name"] = self.error_class(["This field is required when there is a kataster number."])
if self.cleaned_data.get("area") == []: if self.cleaned_data.get("area") == []:
self._errors["area"] = self.error_class(["This field is required."]) self._errors["area"] = self.error_class(["This field is required."])
if self.cleaned_data.get("url").startswith("/"): if self.cleaned_data.get("url") and self.cleaned_data.get("url").startswith("/"):
self._errors["url"] = self.error_class(["This field can not start with a /."]) self._errors["url"] = self.error_class(["This field can not start with a /."])
return self.cleaned_data return self.cleaned_data