2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-05-10 03:15:46 +01:00

make robust against None value

This commit is contained in:
Philip Sargent 2023-11-17 13:03:48 +02:00
parent 41e64a217c
commit ddf88d5394

@ -218,6 +218,7 @@ 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 /."])
return self.cleaned_data