Commit 77186c5e authored by Fardale's avatar Fardale

[readhesion] fixe prologement de conneciton

parent af2f99fc
......@@ -503,7 +503,7 @@ class AdhesionView(CableurOrSelfMixin, RedirectHomeMixin, View):
luser = get_admin_luser(request, uid, ptype, 'w')
if form.is_valid():
#EN 2 etapes, on renvoie
if 'confirm' in request.POST.keys() and cgu.is_valid():
if 'confirm' in request.POST.keys():
######## Facturation de la connexion ########
mois = form.cleaned_data['nbrmois']
mois, prix, readhesion = prix(mois, luser, ptype, cablage)
......@@ -521,12 +521,24 @@ class AdhesionView(CableurOrSelfMixin, RedirectHomeMixin, View):
}
########## Réadhésion ###########
# Si la fonct d readhésion a repondu True, on réadhère aussi
if readhesion:
if readhesion and cgu.is_valid():
if ptype == 'club':
dico_adh = cotisation.dico_adh_club
else:
dico_adh = cotisation.dico_adh
fact['article'].append(u'%s~~%s~~%s~~%s' % (dico_adh['code'], dico_adh['designation'], dico_adh['nombre'], dico_adh['pu']))
elif readhesion and not cgu.is_valid():
# Les CGU sont obligatoires
messages.error(request, _(u"La case d'acceptation des textes est obligatoire"))
return render(
request,
self.template_name,
{'form': form,
'cgu': cgu,
'ptype': ptype,
'ide': uid,
'cablage': cablage},
)
elif mois == 0 or ptype == 'club':
# Dans ce cas il n'y a rien à faire
messages.error(request, _(u"La réadhésion n'est possible que moins d'un mois avant l'expiration, merci de repasser"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment