From 4104c91bdbf4bb079a9d0c7588751f66bbfad870 Mon Sep 17 00:00:00 2001
From: Carlos Vega <carlos.vega@uni.lu>
Date: Fri, 20 Mar 2020 09:21:56 +0100
Subject: [PATCH] fixed clean_location method in appointment form

---
 smash/web/forms/appointment_form.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/smash/web/forms/appointment_form.py b/smash/web/forms/appointment_form.py
index b670a032..2bc99e48 100644
--- a/smash/web/forms/appointment_form.py
+++ b/smash/web/forms/appointment_form.py
@@ -105,6 +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
         else:
             return location
 
-- 
GitLab