Correction d'un bug dans l'accès aux pages

This commit is contained in:
Jean-Marie Favreau 2023-12-17 18:05:20 +01:00
parent d79b6ed50a
commit 49f528e395

View File

@ -210,7 +210,7 @@ class EventDetailView(UserPassesTestMixin, DetailView):
template_name = "agenda_culturel/page-event.html" template_name = "agenda_culturel/page-event.html"
def test_func(self): def test_func(self):
return self.request.user.is_authenticated or self.get_object().status != Event.STATUS.PUBLISHED return self.request.user.is_authenticated or self.get_object().status == Event.STATUS.PUBLISHED
@login_required(login_url="/accounts/login/") @login_required(login_url="/accounts/login/")
def change_status_event(request, pk, status): def change_status_event(request, pk, status):