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 == "":