From d2fc58beeb2524a4df149996498c01314a9a635f Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Thu, 8 Oct 2020 15:57:02 +0200 Subject: [PATCH] Fix issue with appointment caching --- teleforma/views/appointment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teleforma/views/appointment.py b/teleforma/views/appointment.py index 7f255556..d287c346 100644 --- a/teleforma/views/appointment.py +++ b/teleforma/views/appointment.py @@ -103,7 +103,7 @@ class Appointments(View): ap.student = user try: ap.save() - cache.delete('%s_%s_%s' % (CACHE_KEY, ap.slot.appointment_period.id, ap.slot.date)) + cache.delete('%s_%s_%s-%s' % (CACHE_KEY, ap.slot.appointment_period.id, ap.slot.date, ap.slot.mode)) self.send_ap_mail(ap) except IntegrityError: # Duplicate appointment caught by the db @@ -163,7 +163,7 @@ def cancel_appointment(request): messages.add_message(request, messages.ERROR, 'Il est trop tard pour annuler ce rendez-vous.') return redirect('teleforma-appointments', period_id=period_id, course_id=course_id) - cache.delete('%s_%s_%s' % (CACHE_KEY, app.slot.appointment_period.id, app.slot.date)) + cache.delete('%s_%s_%s-%s' % (CACHE_KEY, app.slot.appointment_period.id, app.slot.date, app.slot.mode)) app.delete() messages.add_message(request, messages.INFO, 'Votre réservation a été annulé.') return redirect('teleforma-appointments', period_id=period_id, course_id=course_id) -- 2.39.5