2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 06:17:07 +00:00

cave areacode requirement enforced

This commit is contained in:
2025-07-12 16:48:01 +03:00
parent 468634527f
commit dbec098bba
2 changed files with 5 additions and 1 deletions

View File

@@ -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