summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWookey <wookey@wookware.org>2018-02-28 15:57:27 +0000
committerWookey <wookey@wookware.org>2018-02-28 15:57:27 +0000
commit0c2a6b49ba7bdd050ec1fc5cb44b7c190cc8ccdc (patch)
treefa540f86a6fcc0276ed7ca4e8486afc5ddc0bb16
parent6481fda4d7506f62e0bd78ce5bfb7cd9ecda8eed (diff)
parent86b1e6e5771ee632166835e26a67e0cdbfb5b3c3 (diff)
downloadtroggle-0c2a6b49ba7bdd050ec1fc5cb44b7c190cc8ccdc.tar.gz
troggle-0c2a6b49ba7bdd050ec1fc5cb44b7c190cc8ccdc.tar.bz2
troggle-0c2a6b49ba7bdd050ec1fc5cb44b7c190cc8ccdc.zip
Avoid barf if URL field in new cave form is left blank.
-rw-r--r--core/forms.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/forms.py b/core/forms.py
index 9d02066..4530b0e 100644
--- a/core/forms.py
+++ b/core/forms.py
@@ -29,7 +29,7 @@ class CaveForm(ModelForm):
self._errors["official_name"] = self.error_class(["This field is required when there is a kataster number."])
if self.cleaned_data.get("area") == []:
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 /."])
return self.cleaned_data