diff --git a/bda/templates/liste-reventes.html b/bda/templates/liste-reventes.html index 2a5ddc95..78f3ac08 100644 --- a/bda/templates/liste-reventes.html +++ b/bda/templates/liste-reventes.html @@ -2,7 +2,10 @@ {% load bootstrap %} {% block realcontent %} -
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..4f1ba977 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 @@ -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: diff --git a/cof/settings_dev.py b/cof/settings_dev.py index 5e092635..b2bda35d 100644 --- a/cof/settings_dev.py +++ b/cof/settings_dev.py @@ -154,8 +154,8 @@ MAIL_DATA = { 'FROM': 'Le BdA