summaryrefslogtreecommitdiffstats
path: root/core/forms.py
diff options
context:
space:
mode:
authorexpo <expo@expobox.potato.hut>2016-06-09 04:16:46 +0100
committerexpo <expo@expobox.potato.hut>2016-06-09 04:16:46 +0100
commit4320e7629813aef22a8778b12efdb593687542da (patch)
tree1a625d478f7c21504c98e6a91ccfd0dfca79787e /core/forms.py
parentc3952cf3e75ae0cfea234eb6ff5ee595d4297e82 (diff)
parent32f3dac62196e3cad7b9a9b1b949d6970529666f (diff)
downloadtroggle-4320e7629813aef22a8778b12efdb593687542da.tar.gz
troggle-4320e7629813aef22a8778b12efdb593687542da.tar.bz2
troggle-4320e7629813aef22a8778b12efdb593687542da.zip
merge serve changes
HGerver canges Enter commit message. Lines beginning with 'HG:' are removed.
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