diff options
author | expoonserver <devnull@localhost> | 2017-10-25 03:49:03 +0100 |
---|---|---|
committer | expoonserver <devnull@localhost> | 2017-10-25 03:49:03 +0100 |
commit | 86b1e6e5771ee632166835e26a67e0cdbfb5b3c3 (patch) | |
tree | 8ac384a8fa01ca4f574419800c0339108184e7ad | |
parent | d7b2ddefcea28c66f4e353bceea4171eda68cfd2 (diff) | |
download | troggle-86b1e6e5771ee632166835e26a67e0cdbfb5b3c3.tar.gz troggle-86b1e6e5771ee632166835e26a67e0cdbfb5b3c3.tar.bz2 troggle-86b1e6e5771ee632166835e26a67e0cdbfb5b3c3.zip |
Test whether url is not 'None' before applying 'startswith' test in
forms.py entering new caves, otherwise it barfs.
-rw-r--r-- | core/forms.py | 2 |
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 |