Projet

Général

Profil

« Précédent | Suivant » 

Révision ac97a317

Ajouté par Serghei Mihai il y a plus de 9 ans

agenda: cleaning up all schedule related cookies when visiting service homepage

Voir les différences:

calebasse/agenda/views.py
38 38

  
39 39
class AgendaHomepageView(TemplateView):
40 40
    template_name = 'agenda/index.html'
41
    cookies_to_clear = []
42 41

  
43 42
    def post(self, request, *args, **kwargs):
44 43
        acte_id = request.POST.get('event-id')
......
138 137
    form_class = NewAppointmentForm
139 138
    template_name = 'agenda/new-appointment.html'
140 139
    success_msg = u'Rendez-vous enregistré avec succès.'
141
    cookies_to_clear = []
142 140

  
143 141
    def get_initial(self):
144 142
        initial = super(NewAppointmentView, self).get_initial()
......
173 171
    form_class = UpdateAppointmentForm
174 172
    template_name = 'agenda/update-rdv.html'
175 173
    success_url = '..'
176
    cookies_to_clear = []
177 174

  
178 175
    def get_initial(self):
179 176
        initial = super(BaseAppointmentView, self).get_initial()
......
207 204
    form_class = UpdatePeriodicAppointmentForm
208 205
    template_name = 'agenda/new-appointment.html'
209 206

  
210

  
211 207
class NewEventView(CreateView):
212 208
    model = Event
213 209
    form_class = NewEventForm
214 210
    template_name = 'agenda/new-event.html'
215
    cookies_to_clear = []
216 211

  
217 212
    def get_initial(self):
218 213
        initial = super(NewEventView, self).get_initial()
......
244 239
    form_class = UpdateEventForm
245 240
    template_name = 'agenda/update-event.html'
246 241
    success_url = '..'
247
    cookies_to_clear = []
248 242

  
249 243
    def get_initial(self):
250 244
        initial = super(BaseEventView, self).get_initial()
......
277 271
class DeleteOccurrenceView(TodayOccurrenceMixin, cbv.DeleteView):
278 272
    model = Event
279 273
    success_url = '..'
280
    cookies_to_clear = []
281 274

  
282 275
    def delete(self, request, *args, **kwargs):
283 276
        self.object = self.get_object()
......
289 282
class DeleteEventView(cbv.DeleteView):
290 283
    model = Event
291 284
    success_url = '..'
292
    cookies_to_clear = []
293 285

  
294 286
    def delete(self, request, *args, **kwargs):
295 287
        self.object = self.get_object()
......
524 516
class AjaxWorkerTabView(TemplateView):
525 517

  
526 518
    template_name = 'agenda/ajax-worker-tab.html'
527
    cookies_to_clear = []
528 519

  
529 520
    def get_context_data(self, worker_id, **kwargs):
530 521
        context = super(AjaxWorkerTabView, self).get_context_data(**kwargs)
......
573 564

  
574 565
class AjaxRessourceTabView(TemplateView):
575 566
    template_name = 'agenda/ajax-ressource-tab.html'
576
    cookies_to_clear = []
577 567

  
578 568
    def get_context_data(self, ressource_id, **kwargs):
579 569
        context = super(AjaxRessourceTabView, self).get_context_data(**kwargs)
......
592 582
class AjaxDisponibilityColumnView(TemplateView):
593 583

  
594 584
    template_name = 'agenda/ajax-disponibility-column.html'
595
    cookies_to_clear = []
596 585

  
597 586
    def get_ressource_context_data(self, ressource_id, context):
598 587
        ressource = Ressource.objects.get(pk = ressource_id)
calebasse/cbv.py
40 40
    service = None
41 41
    date = None
42 42
    popup = False
43
    cookies_to_clear = [('agenda-tabs', ), ('active-agenda', ), ('last-ressource', )]
43
    cookies_to_clear = []
44 44

  
45 45
    def clear_cookies(self, response, path):
46 46
        for cookie in self.cookies_to_clear:
calebasse/views.py
32 32
        if 'service' in kwargs:
33 33
            self.cookies_to_clear = [('agenda-tabs',
34 34
                                      '/%s/agenda' % kwargs['service']),
35
                                     ('agenda-ressource-tabs',
35
                                     ('active-agenda',
36
                                      '/%s/agenda' % kwargs['service']),
37
                                     ('last-ressource',
36 38
                                      '/%s/agenda' % kwargs['service']),
37 39
                                     ]
38 40
        return super(Homepage, self).dispatch(request, **kwargs)

Formats disponibles : Unified diff