Cache les tirages pas encore ouverts au public

Seul le Burô peut voir les tirages actif pas encore ouverts.
This commit is contained in:
Martin Pépin 2016-08-29 16:32:04 +02:00
parent a5fa6950f5
commit 1f8f94b93b
2 changed files with 6 additions and 3 deletions

View file

@ -83,8 +83,8 @@
</div>
<h3 class="block-title">Gestion tirages BDA<span class="pull-right glyphicon glyphicon-list"></span></h3>
<div class="hm-block">
{% if open_tirages %}
{% for tirage in open_tirages %}
{% if active_tirages %}
{% for tirage in active_tirages %}
<ul>
<h4>{{ tirage.title }}</h4>
<li><a href="{% url "bda-liste-spectacles" tirage.id %}">Spectacles</a></li>

View file

@ -42,7 +42,10 @@ def home(request):
Survey.objects.filter(survey_open=True, old=False).all(),
"open_events":
Event.objects.filter(registration_open=True, old=False).all(),
"open_tirages": Tirage.objects.filter(active=True).all(),
"active_tirages": Tirage.objects.filter(active=True).all(),
"open_tirages":
Tirage.objects.filter(active=True,
ouverture__lte=timezone.now()).all(),
"now": timezone.now()}
return render(request, "home.html", data)