On autorise a voir les élections dont on est l'admin
This commit is contained in:
parent
2cf4315eaa
commit
363b181d22
1 changed files with 6 additions and 6 deletions
|
@ -364,12 +364,12 @@ class ElectionView(DetailView):
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return (
|
user = self.request.user
|
||||||
super()
|
qs = super().get_queryset().prefetch_related("questions__options")
|
||||||
.get_queryset()
|
if user.is_authenticated:
|
||||||
.filter(archived=False)
|
return qs.filter(Q(archived=False) | Q(created_by=user))
|
||||||
.prefetch_related("questions__options")
|
|
||||||
)
|
return qs.filter(archived=False)
|
||||||
|
|
||||||
|
|
||||||
class ElectionVotersView(DetailView):
|
class ElectionVotersView(DetailView):
|
||||||
|
|
Loading…
Reference in a new issue