Fixe un bug lors de l'affichage des élections
This commit is contained in:
parent
3d1318587e
commit
101630524d
1 changed files with 6 additions and 5 deletions
|
@ -334,11 +334,12 @@ class ElectionListView(ListView):
|
||||||
template_name = "elections/election_list.html"
|
template_name = "elections/election_list.html"
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return (
|
user = self.request.user
|
||||||
super()
|
qs = super().get_queryset()
|
||||||
.get_queryset()
|
if user.is_authenticated:
|
||||||
.filter(Q(archived=False) | Q(created_by=self.request.user))
|
return qs.filter(Q(archived=False) | Q(created_by=self.request.user))
|
||||||
)
|
|
||||||
|
return qs.filter(archived=False)
|
||||||
|
|
||||||
|
|
||||||
class ElectionView(DetailView):
|
class ElectionView(DetailView):
|
||||||
|
|
Loading…
Reference in a new issue