2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

url code commented out

This commit is contained in:
Philip Sargent 2023-11-17 18:30:00 +02:00
parent ddf88d5394
commit d333ebe88e

View File

@ -119,10 +119,10 @@ class CaveForm(ModelForm):
)
# if self.cleaned_data.get("kataster_number") != "" and self.cleaned_data.get("official_name") == "":
# self._errors["official_name"] = self.error_class(["This field is required when there is a kataster number."])
if cleaned_data.get("url") == []:
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 cleaned_data.get("url") == []:
# 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 /."])
return cleaned_data
@ -218,9 +218,9 @@ class EntranceForm(ModelForm):
)
def clean(self):
if self.cleaned_data.get("url"):
if self.cleaned_data.get("url").startswith("/"):
self._errors["url"] = self.error_class(["This field cannot start with a /."])
# if self.cleaned_data.get("url"): # can remove this as the form does not have a url field any more, which was never used anyway
# if self.cleaned_data.get("url").startswith("/"):
# self._errors["url"] = self.error_class(["This field cannot start with a /."])
return self.cleaned_data