summaryrefslogtreecommitdiffstats
path: root/core/forms.py
diff options
context:
space:
mode:
authorexpo <expo@expobox.potato.hut>2015-09-16 01:52:45 +0100
committerexpo <expo@expobox.potato.hut>2015-09-16 01:52:45 +0100
commit73e27355b1ed4e62c4514153d66526d2d3cf8fe8 (patch)
tree11b669c292f2d912d383f02849669b5f9f29885c /core/forms.py
parent58831117e903c362447d23bba06e51265787d015 (diff)
downloadtroggle-73e27355b1ed4e62c4514153d66526d2d3cf8fe8.tar.gz
troggle-73e27355b1ed4e62c4514153d66526d2d3cf8fe8.tar.bz2
troggle-73e27355b1ed4e62c4514153d66526d2d3cf8fe8.zip
Commit changes made on expo 2015
Diffstat (limited to 'core/forms.py')
-rw-r--r--core/forms.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/forms.py b/core/forms.py
index 75814ee..9d02066 100644
--- a/core/forms.py
+++ b/core/forms.py
@@ -29,6 +29,8 @@ 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("/"):
+ self._errors["url"] = self.error_class(["This field can not start with a /."])
return self.cleaned_data
class VersionControlCommentForm(forms.Form):
@@ -53,6 +55,10 @@ class EntranceForm(ModelForm):
class Meta:
model = Entrance
exclude = ("cached_primary_slug", "filename",)
+ def clean(self):
+ if self.cleaned_data.get("url").startswith("/"):
+ self._errors["url"] = self.error_class(["This field can not start with a /."])
+ return self.cleaned_data