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
|
@ -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,13 +491,15 @@ 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é "
|
msg = ("L'inscription de {:s} (<tt>{:s}</tt>) a été "
|
||||||
"enregistrée avec succès."
|
"enregistrée avec succès."
|
||||||
.format(member.get_full_name(), member.email))
|
.format(member.get_full_name(), member.email))
|
||||||
if member.profile.is_cof:
|
if profile.is_cof:
|
||||||
msg += "\nIl est désormais membre du COF n°{:d} !".format(
|
msg += "\nIl est désormais membre du COF n°{:d} !".format(
|
||||||
member.profile.id)
|
member.profile.id)
|
||||||
messages.success(request, msg, extra_tags='safe')
|
messages.success(request, msg, extra_tags='safe')
|
||||||
|
|
Loading…
Reference in a new issue