Skip to content
Snippets Groups Projects
Commit 9957abef authored by Carlos Vega's avatar Carlos Vega
Browse files

raise exception on clean_location failure

parent 4104c91b
No related branches found
No related tags found
1 merge request!229Feature/provenance
Pipeline #23036 failed
......@@ -105,7 +105,7 @@ class AppointmentEditForm(AppointmentForm):
location = self.cleaned_data['location']
if self.user.locations.filter(id=location.id).count() == 0:
self.add_error('location', "You cannot create appointment for this location")
return None
raise forms.ValidationError("You cannot create appointment for this location")
else:
return location
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment