summaryrefslogtreecommitdiffstats
path: root/core/forms.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-07-12 16:48:01 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2025-07-12 16:48:01 +0300
commitdbec098bba7439210a275b29201e0a7422882c7c (patch)
treed1d0a904338bb86b558a93a07ed407ba108e7b6a /core/forms.py
parent468634527f41fef389b7ab8aac2c7aa694664857 (diff)
downloadtroggle-dbec098bba7439210a275b29201e0a7422882c7c.tar.gz
troggle-dbec098bba7439210a275b29201e0a7422882c7c.tar.bz2
troggle-dbec098bba7439210a275b29201e0a7422882c7c.zip
cave areacode requirement enforced
Diffstat (limited to 'core/forms.py')
-rw-r--r--core/forms.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/forms.py b/core/forms.py
index 0bcd6ef..b9a8c1f 100644
--- a/core/forms.py
+++ b/core/forms.py
@@ -149,6 +149,10 @@ class CaveForm(ModelForm):
# self._errors["url"] = self.error_class(["This field is required."])
# if cleaned_data.get("url") and cleaned_data.get("url").startswith("/"):
# self._errors["url"] = self.error_class(["This field cannot start with a /."])
+ if self.data.get("areacode") == "":
+ self._errors["areacode"] = self.error_class(
+ ["An areacode, e.g. 1623, is required."]
+ )
return cleaned_data