summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei MIHAI <smihai@entrouvert.com>2014-09-19 14:32:05 (GMT)
committerSerghei MIHAI <smihai@entrouvert.com>2014-09-19 15:46:36 (GMT)
commitac97a3174f87d02167dc85e1e5d3e2187c8be74d (patch)
tree1a1ce80480a4b809823ccee9433f4d23415c05a8
parent5b391eec74220c130e24f98498c8ddc7d356a35b (diff)
downloadcalebasse-ac97a3174f87d02167dc85e1e5d3e2187c8be74d.zip
calebasse-ac97a3174f87d02167dc85e1e5d3e2187c8be74d.tar.gz
calebasse-ac97a3174f87d02167dc85e1e5d3e2187c8be74d.tar.bz2
agenda: cleaning up all schedule related cookies when visiting service homepage
-rw-r--r--calebasse/agenda/views.py11
-rw-r--r--calebasse/cbv.py2
-rw-r--r--calebasse/views.py4
3 files changed, 4 insertions, 13 deletions
diff --git a/calebasse/agenda/views.py b/calebasse/agenda/views.py
index 8478c4c..6d19d60 100644
--- a/calebasse/agenda/views.py
+++ b/calebasse/agenda/views.py
@@ -38,7 +38,6 @@ def redirect_today(request, service):
class AgendaHomepageView(TemplateView):
template_name = 'agenda/index.html'
- cookies_to_clear = []
def post(self, request, *args, **kwargs):
acte_id = request.POST.get('event-id')
@@ -138,7 +137,6 @@ class NewAppointmentView(cbv.ServiceFormMixin, CreateView):
form_class = NewAppointmentForm
template_name = 'agenda/new-appointment.html'
success_msg = u'Rendez-vous enregistré avec succès.'
- cookies_to_clear = []
def get_initial(self):
initial = super(NewAppointmentView, self).get_initial()
@@ -173,7 +171,6 @@ class BaseAppointmentView(UpdateView):
form_class = UpdateAppointmentForm
template_name = 'agenda/update-rdv.html'
success_url = '..'
- cookies_to_clear = []
def get_initial(self):
initial = super(BaseAppointmentView, self).get_initial()
@@ -207,12 +204,10 @@ class UpdatePeriodicAppointmentView(BaseAppointmentView):
form_class = UpdatePeriodicAppointmentForm
template_name = 'agenda/new-appointment.html'
-
class NewEventView(CreateView):
model = Event
form_class = NewEventForm
template_name = 'agenda/new-event.html'
- cookies_to_clear = []
def get_initial(self):
initial = super(NewEventView, self).get_initial()
@@ -244,7 +239,6 @@ class BaseEventView(UpdateView):
form_class = UpdateEventForm
template_name = 'agenda/update-event.html'
success_url = '..'
- cookies_to_clear = []
def get_initial(self):
initial = super(BaseEventView, self).get_initial()
@@ -277,7 +271,6 @@ class UpdatePeriodicEventView(BaseEventView):
class DeleteOccurrenceView(TodayOccurrenceMixin, cbv.DeleteView):
model = Event
success_url = '..'
- cookies_to_clear = []
def delete(self, request, *args, **kwargs):
self.object = self.get_object()
@@ -289,7 +282,6 @@ class DeleteOccurrenceView(TodayOccurrenceMixin, cbv.DeleteView):
class DeleteEventView(cbv.DeleteView):
model = Event
success_url = '..'
- cookies_to_clear = []
def delete(self, request, *args, **kwargs):
self.object = self.get_object()
@@ -524,7 +516,6 @@ class JoursNonVerrouillesView(TemplateView):
class AjaxWorkerTabView(TemplateView):
template_name = 'agenda/ajax-worker-tab.html'
- cookies_to_clear = []
def get_context_data(self, worker_id, **kwargs):
context = super(AjaxWorkerTabView, self).get_context_data(**kwargs)
@@ -573,7 +564,6 @@ class AjaxWorkerTabView(TemplateView):
class AjaxRessourceTabView(TemplateView):
template_name = 'agenda/ajax-ressource-tab.html'
- cookies_to_clear = []
def get_context_data(self, ressource_id, **kwargs):
context = super(AjaxRessourceTabView, self).get_context_data(**kwargs)
@@ -592,7 +582,6 @@ class AjaxRessourceTabView(TemplateView):
class AjaxDisponibilityColumnView(TemplateView):
template_name = 'agenda/ajax-disponibility-column.html'
- cookies_to_clear = []
def get_ressource_context_data(self, ressource_id, context):
ressource = Ressource.objects.get(pk = ressource_id)
diff --git a/calebasse/cbv.py b/calebasse/cbv.py
index 7c39752..20ff999 100644
--- a/calebasse/cbv.py
+++ b/calebasse/cbv.py
@@ -40,7 +40,7 @@ class ServiceViewMixin(object):
service = None
date = None
popup = False
- cookies_to_clear = [('agenda-tabs', ), ('active-agenda', ), ('last-ressource', )]
+ cookies_to_clear = []
def clear_cookies(self, response, path):
for cookie in self.cookies_to_clear:
diff --git a/calebasse/views.py b/calebasse/views.py
index 855b97a..c0bb9ef 100644
--- a/calebasse/views.py
+++ b/calebasse/views.py
@@ -32,7 +32,9 @@ class Homepage(TemplateView):
if 'service' in kwargs:
self.cookies_to_clear = [('agenda-tabs',
'/%s/agenda' % kwargs['service']),
- ('agenda-ressource-tabs',
+ ('active-agenda',
+ '/%s/agenda' % kwargs['service']),
+ ('last-ressource',
'/%s/agenda' % kwargs['service']),
]
return super(Homepage, self).dispatch(request, **kwargs)