forked from DGNum/gestioCOF
Proper use of messages in events
This commit is contained in:
parent
b12b5c938f
commit
1fe1b94afc
2 changed files with 7 additions and 5 deletions
|
@ -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 %}
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue