diff --git a/smash/web/forms/appointment_form.py b/smash/web/forms/appointment_form.py index 9a45e77c16678765584a9445147e5e77ab61891f..258132acee57baac4c3b3cfc55be2ecfa5cb68df 100644 --- a/smash/web/forms/appointment_form.py +++ b/smash/web/forms/appointment_form.py @@ -106,7 +106,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