diff --git a/bda/views.py b/bda/views.py index 4ffae2eb..58c54a01 100644 --- a/bda/views.py +++ b/bda/views.py @@ -468,14 +468,11 @@ def revente_shotgun(request, tirage_id): date__gte=timezone.now()) shotgun = [] for spectacle in spectacles: - revente_objects = SpectacleRevente.objects.filter( + reventes = SpectacleRevente.objects.filter( attribution__spectacle=spectacle, + shotgun=True, soldTo__isnull=True) - revente_count = 0 - for revente in revente_objects: - if revente.shotgun: - revente_count += 1 - if revente_count: + if reventes.exists(): shotgun.append(spectacle) return render(request, "bda-shotgun.html",