Fixe un bug lors de l'affichage des élections

This commit is contained in:
Tom Hubrecht 2021-03-28 18:15:06 +02:00
parent 3d1318587e
commit 101630524d

View file

@ -334,11 +334,12 @@ class ElectionListView(ListView):
template_name = "elections/election_list.html"
def get_queryset(self):
return (
super()
.get_queryset()
.filter(Q(archived=False) | Q(created_by=self.request.user))
)
user = self.request.user
qs = super().get_queryset()
if user.is_authenticated:
return qs.filter(Q(archived=False) | Q(created_by=self.request.user))
return qs.filter(archived=False)
class ElectionView(DetailView):