From 250f0b68e56c7774f97fb5712ba6a4ba4c555356 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 16 Dec 2023 21:34:33 +0100 Subject: [PATCH] =?UTF-8?q?correction=20d'un=20bug=20quand=20on=20publie?= =?UTF-8?q?=20un=20=C3=A9v=C3=A9nement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 3b75418..6f0add3 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -214,10 +214,10 @@ def change_status_event(request, pk, status): event.status = Event.STATUS(status) event.save(update_fields=["status"]) - if self.request.user.is_authenticated: - return event.get_absolute_url() + if request.user.is_authenticated: + return HttpResponseRedirect(event.get_absolute_url()) else: - return reverse_lazy("home") + return HttpResponseRedirect(reverse_lazy("home")) else: cancel_url = request.META.get('HTTP_REFERER', '') if cancel_url == "":