diff --git a/bda/migrations/0004_add_tirage_switch.py b/bda/migrations/0005_add_tirage_switch.py similarity index 94% rename from bda/migrations/0004_add_tirage_switch.py rename to bda/migrations/0005_add_tirage_switch.py index 7429197b..fa3644f6 100644 --- a/bda/migrations/0004_add_tirage_switch.py +++ b/bda/migrations/0005_add_tirage_switch.py @@ -19,7 +19,7 @@ def forwards_func(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('bda', '0003_update_tirage_and_spectacle'), + ('bda', '0004_mails-rappel'), ] operations = [ diff --git a/bda/templates/tirage-failed.html b/bda/templates/tirage-failed.html index 78c547fd..74849487 100644 --- a/bda/templates/tirage-failed.html +++ b/bda/templates/tirage-failed.html @@ -3,6 +3,8 @@ {% block realcontent %}

Raté, le tirage ne peut pas être lancé !

-

Si vous savez ce que vous faites, vous pouvez autoriser le lancement du -tirage dans l'interface admin.

+

Soit les inscriptions ne sont en pas encore fermées, soit le lancement du +tirage est désactivé. Si vous savez ce que vous faites, vous pouvez autoriser +le lancement du tirage dans +l'interface admin.

{% endblock %} diff --git a/bda/views.py b/bda/views.py index d9f89b2d..dd53dbd2 100644 --- a/bda/views.py +++ b/bda/views.py @@ -263,7 +263,8 @@ def do_tirage(request, tirage_id): @buro_required def tirage(request, tirage_id): tirage_elt = get_object_or_404(Tirage, id=tirage_id) - if not tirage_elt.enable_do_tirage: + if not (tirage_elt.enable_do_tirage + and tirage_elt.fermeture < timezone.now()): return render(request, "tirage-failed.html", {'tirage': tirage_elt}) if request.POST: form = TokenForm(request.POST)