forked from DGNum/gestioCOF
Fewer requests on unpaid view
This commit is contained in:
parent
15d2faf8e1
commit
98f355ed20
1 changed files with 6 additions and 3 deletions
|
@ -670,9 +670,12 @@ class SpectacleListView(ListView):
|
|||
@buro_required
|
||||
def unpaid(request, tirage_id):
|
||||
tirage = get_object_or_404(Tirage, id=tirage_id)
|
||||
unpaid = tirage.participant_set \
|
||||
.annotate(nb_attributions=Count('attribution')) \
|
||||
.filter(paid=False, nb_attributions__gt=0).all()
|
||||
unpaid = (
|
||||
tirage.participant_set
|
||||
.annotate(nb_attributions=Count('attribution'))
|
||||
.filter(paid=False, nb_attributions__gt=0)
|
||||
.select_related('user')
|
||||
)
|
||||
return render(request, "bda-unpaid.html", {"unpaid": unpaid})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue