forked from DGNum/gestioCOF
Registration: remove success var, fix message
`member.profile` was not up-to-date where we used to send the success message => move it to the place where the success var is set tu `True` and remove the success var was which becomes irrelevant.
This commit is contained in:
parent
dba8a0a857
commit
f0f1585661
1 changed files with 12 additions and 11 deletions
|
@ -402,7 +402,6 @@ def registration(request):
|
||||||
request_dict = request.POST.copy()
|
request_dict = request.POST.copy()
|
||||||
member = None
|
member = None
|
||||||
login_clipper = None
|
login_clipper = None
|
||||||
success = False
|
|
||||||
|
|
||||||
# -----
|
# -----
|
||||||
# Remplissage des formulaires
|
# Remplissage des formulaires
|
||||||
|
@ -492,16 +491,18 @@ def registration(request):
|
||||||
for club in clubs_form.cleaned_data['clubs']:
|
for club in clubs_form.cleaned_data['clubs']:
|
||||||
club.membres.add(member)
|
club.membres.add(member)
|
||||||
club.save()
|
club.save()
|
||||||
success = True
|
|
||||||
# Messages
|
# ---
|
||||||
if success:
|
# Success
|
||||||
msg = ("L'inscription de {:s} (<tt>{:s}</tt>) a été "
|
# ---
|
||||||
"enregistrée avec succès."
|
|
||||||
.format(member.get_full_name(), member.email))
|
msg = ("L'inscription de {:s} (<tt>{:s}</tt>) a été "
|
||||||
if member.profile.is_cof:
|
"enregistrée avec succès."
|
||||||
msg += "\nIl est désormais membre du COF n°{:d} !".format(
|
.format(member.get_full_name(), member.email))
|
||||||
member.profile.id)
|
if profile.is_cof:
|
||||||
messages.success(request, msg, extra_tags='safe')
|
msg += "\nIl est désormais membre du COF n°{:d} !".format(
|
||||||
|
member.profile.id)
|
||||||
|
messages.success(request, msg, extra_tags='safe')
|
||||||
return render(request, "gestioncof/registration_post.html",
|
return render(request, "gestioncof/registration_post.html",
|
||||||
{"user_form": user_form,
|
{"user_form": user_form,
|
||||||
"profile_form": profile_form,
|
"profile_form": profile_form,
|
||||||
|
|
Loading…
Reference in a new issue