From 284dc12b7c1a9b212ec2bbad47e51ea0e9e61d34 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Tue, 27 Sep 2016 17:35:29 +0200 Subject: [PATCH] success message --- bda/templates/liste-reventes.html | 3 +++ bda/views.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bda/templates/liste-reventes.html b/bda/templates/liste-reventes.html index 2a236176..78f3ac08 100644 --- a/bda/templates/liste-reventes.html +++ b/bda/templates/liste-reventes.html @@ -3,6 +3,9 @@ {% block realcontent %}

Inscriptions pour BdA-Revente

+ {% if success %} +

Ton inscription a bien été prise en compte !

+ {% endif %} {% if deja_revente %}

Des reventes existent déjà pour certains de ces spectacles ; vérifie les places disponibles sans tirage !

{% endif %} diff --git a/bda/views.py b/bda/views.py index e9a000cb..c72e5b1d 100644 --- a/bda/views.py +++ b/bda/views.py @@ -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