message si inscription a une revente en cours
This commit is contained in:
parent
82b6cea02f
commit
e8be072e78
2 changed files with 7 additions and 1 deletions
|
@ -8,7 +8,10 @@
|
|||
{% 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>
|
||||
{% elif inscrit_revente %}
|
||||
<p class="success">Tu as été inscrit à une revente en cours pour ce spectacle !</p>
|
||||
{% endif %}
|
||||
|
||||
<form action="" class="form-horizontal" method="post">
|
||||
{% csrf_token %}
|
||||
<div class="form-group">
|
||||
|
|
|
@ -388,6 +388,7 @@ def list_revente(request, tirage_id):
|
|||
user=request.user, tirage=tirage)
|
||||
deja_revente = False
|
||||
success = False
|
||||
inscrit_revente = False
|
||||
if request.method == 'POST':
|
||||
form = InscriptionReventeForm(tirage, request.POST)
|
||||
if form.is_valid():
|
||||
|
@ -405,6 +406,7 @@ def list_revente(request, tirage_id):
|
|||
else:
|
||||
revente.answered_mail.add(participant)
|
||||
revente.save()
|
||||
inscrit_revente = True
|
||||
break
|
||||
success = True
|
||||
else:
|
||||
|
@ -414,7 +416,8 @@ def list_revente(request, tirage_id):
|
|||
|
||||
return render(request, "liste-reventes.html",
|
||||
{"form": form,
|
||||
"deja_revente": deja_revente, "success": success})
|
||||
"deja_revente": deja_revente, "success": success,
|
||||
"inscrit_revente": inscrit_revente})
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
Loading…
Reference in a new issue