forked from DGNum/gestioCOF
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 %}
|
{% endif %}
|
||||||
{% if deja_revente %}
|
{% if deja_revente %}
|
||||||
<p class="success">Des reventes existent déjà pour certains de ces spectacles ; vérifie les places disponibles sans tirage !</p>
|
<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 %}
|
{% endif %}
|
||||||
|
|
||||||
<form action="" class="form-horizontal" method="post">
|
<form action="" class="form-horizontal" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -388,6 +388,7 @@ def list_revente(request, tirage_id):
|
||||||
user=request.user, tirage=tirage)
|
user=request.user, tirage=tirage)
|
||||||
deja_revente = False
|
deja_revente = False
|
||||||
success = False
|
success = False
|
||||||
|
inscrit_revente = False
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = InscriptionReventeForm(tirage, request.POST)
|
form = InscriptionReventeForm(tirage, request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
|
@ -405,6 +406,7 @@ def list_revente(request, tirage_id):
|
||||||
else:
|
else:
|
||||||
revente.answered_mail.add(participant)
|
revente.answered_mail.add(participant)
|
||||||
revente.save()
|
revente.save()
|
||||||
|
inscrit_revente = True
|
||||||
break
|
break
|
||||||
success = True
|
success = True
|
||||||
else:
|
else:
|
||||||
|
@ -414,7 +416,8 @@ def list_revente(request, tirage_id):
|
||||||
|
|
||||||
return render(request, "liste-reventes.html",
|
return render(request, "liste-reventes.html",
|
||||||
{"form": form,
|
{"form": form,
|
||||||
"deja_revente": deja_revente, "success": success})
|
"deja_revente": deja_revente, "success": success,
|
||||||
|
"inscrit_revente": inscrit_revente})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|
Loading…
Reference in a new issue