Merge branch 'master' into Kerl/settings_syntax

This commit is contained in:
Martin Pépin 2016-10-03 01:58:55 +02:00
commit 1a6b86703a
5 changed files with 15 additions and 9 deletions

View file

@ -2,7 +2,10 @@
{% load bootstrap %}
{% block realcontent %}
<h2>Inscriptions pour BDA-Revente</h2>
<h2>Inscriptions pour BdA-Revente</h2>
{% if success %}
<p class="success">Ton inscription a bien été prise en compte !</p>
{% endif %}
{% if deja_revente %}
<p class="success">Des reventes existent déjà pour certains de ces spectacles ; vérifie les places disponibles sans tirage !</p>
{% endif %}

View file

@ -382,6 +382,7 @@ def list_revente(request, tirage_id):
date__gte=timezone.now())
shotgun = []
deja_revente = False
success = False
for spectacle in spectacles:
revente_objects = SpectacleRevente.objects.filter(
attribution__spectacle=spectacle,
@ -410,7 +411,9 @@ def list_revente(request, tirage_id):
deja_revente = True
else:
revente.answered_mail.add(participant)
revente.save()
break
success = True
else:
form = InscriptionReventeForm(
tirage,
@ -418,7 +421,7 @@ def list_revente(request, tirage_id):
return render(request, "liste-reventes.html",
{"form": form, 'shotgun': shotgun,
"deja_revente": deja_revente})
"deja_revente": deja_revente, "success": success})
@login_required
@ -440,7 +443,7 @@ def buy_revente(request, spectacle_id):
if revente.shotgun:
reventes_shotgun.append(revente)
if reventes_shotgun.empty():
if not reventes_shotgun:
return render(request, "bda-no-revente.html", {})
if request.POST: