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 %}
|
{% block realcontent %}
|
||||||
<h2>Événement: {{ event.title }}</h2>
|
<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 %}
|
{% if event.details %}
|
||||||
<p>{{ event.details }}</p>
|
<p>{{ event.details }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -224,8 +224,13 @@ def event(request, event_id):
|
||||||
current_choices=current_registration.options)
|
current_choices=current_registration.options)
|
||||||
except EventRegistration.DoesNotExist:
|
except EventRegistration.DoesNotExist:
|
||||||
form = EventForm(event=event)
|
form = EventForm(event=event)
|
||||||
return render(request, "event.html",
|
# Messages
|
||||||
{"event": event, "form": form, "success": success})
|
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):
|
def clean_post_for_status(initial):
|
||||||
|
|
Loading…
Reference in a new issue