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"
|
||||
|
||||
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):
|
||||
|
|
Loading…
Reference in a new issue