From dbec098bba7439210a275b29201e0a7422882c7c Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 12 Jul 2025 16:48:01 +0300 Subject: cave areacode requirement enforced --- core/forms.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/forms.py') 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 -- cgit v1.2.3