From 84e8f76c67a885bd721c8e24dde3343dad35cd48 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 4 Mar 2018 09:50:39 +0100 Subject: [PATCH] Fix session_pk deletion --- gym/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gym/views.py b/gym/views.py index 3a7d487..249eada 100644 --- a/gym/views.py +++ b/gym/views.py @@ -13,7 +13,7 @@ class RoomListView(generic.ListView): template_name = 'gym/rooms.html' def dispatch(self, request, *args, **kwargs): - if 'session' in request.session: + if 'session_pk' in request.session: del request.session['session_pk'] return super().dispatch(request, *args, **kwargs) @@ -25,7 +25,7 @@ class RoomDetailView(generic.DetailView): template_name = 'gym/room.html' def dispatch(self, request, *args, **kwargs): - if 'session' in request.session: + if 'session_pk' in request.session: del request.session['session_pk'] return super().dispatch(request, *args, **kwargs)