Proper use of messages in events

This commit is contained in:
Martin Pépin 2017-01-30 13:12:01 +01:00
parent b12b5c938f
commit 1fe1b94afc
2 changed files with 7 additions and 5 deletions

View file

@ -2,9 +2,6 @@
{% block realcontent %}
<h2>Événement: {{ event.title }}</h2>
{% if success %}
<p class="success">Votre inscription a bien été enregistrée ! Vous pouvez cependant la modifier jusqu'à la fin des inscriptions.</p>
{% endif %}
{% if event.details %}
<p>{{ event.details }}</p>
{% endif %}

View file

@ -224,8 +224,13 @@ def event(request, event_id):
current_choices=current_registration.options)
except EventRegistration.DoesNotExist:
form = EventForm(event=event)
return render(request, "event.html",
{"event": event, "form": form, "success": success})
# Messages
if success:
messages.success(request, "Votre inscription a bien été enregistrée ! "
"Vous pouvez cependant la modifier jusqu'à "
"la fin des inscriptions.")
return render(request, "gestioncof/event.html",
{"event": event, "form": form})
def clean_post_for_status(initial):