Si il n'y a pas de suffixe, on le rajoute pour eviter les prb
This commit is contained in:
parent
f943cf52a6
commit
28cfce0916
2 changed files with 3 additions and 3 deletions
|
@ -363,10 +363,10 @@ class Dialog(proprio.Dialog):
|
||||||
new_debutconnexion = max(now, finconnexion)
|
new_debutconnexion = max(now, finconnexion)
|
||||||
con_month = new_debutconnexion.month
|
con_month = new_debutconnexion.month
|
||||||
con_year = new_debutconnexion.year
|
con_year = new_debutconnexion.year
|
||||||
new_finconnexion = max(finconnexion, now).replace(year=con_year + ((con_month + mois) // 12), month= (con_month + mois - 1) % 12 + 1)
|
new_finconnexion = max(finconnexion, now).replace(year=con_year + ((con_month + mois) // 13), month= (con_month + mois - 1) % 12 + 1)
|
||||||
|
|
||||||
if (new_finconnexion - finadhesion.value).days > 0:
|
if (new_finconnexion - finadhesion.value).days > 0:
|
||||||
t_end_adh = finadhesion.value()
|
t_end_adh = finadhesion.value
|
||||||
t_end_conn = finconnexion
|
t_end_conn = finconnexion
|
||||||
if (new_finconnexion - finadhesion.value).days > 30:
|
if (new_finconnexion - finadhesion.value).days > 30:
|
||||||
raise ValueError("Impossible de prolonger la connexion jusqu'au %s plus d'un mois après la fin de l'adhésion au %s" % (t_end_conn, t_end_adh))
|
raise ValueError("Impossible de prolonger la connexion jusqu'au %s plus d'un mois après la fin de l'adhésion au %s" % (t_end_conn, t_end_adh))
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Dialog(certificat.Dialog, blacklist.Dialog):
|
||||||
raise ValueError("La machine n'est ni une machine fixe, ni une machine wifi mais %s ?!?" % objectClass)
|
raise ValueError("La machine n'est ni une machine fixe, ni une machine wifi mais %s ?!?" % objectClass)
|
||||||
|
|
||||||
if not host.endswith(hostend) and not '.' in host:
|
if not host.endswith(hostend) and not '.' in host:
|
||||||
host = "%s.wifi.crans.org" % host
|
host = host + hostend
|
||||||
elif host.endswith(hostend) and '.' in host[:-len(hostend)]:
|
elif host.endswith(hostend) and '.' in host[:-len(hostend)]:
|
||||||
raise ValueError("Nom d'hôte invalide, devrait finir par %s et être sans point dans la première partie" % hostend)
|
raise ValueError("Nom d'hôte invalide, devrait finir par %s et être sans point dans la première partie" % hostend)
|
||||||
elif not host.endswith(hostend) and '.' in host:
|
elif not host.endswith(hostend) and '.' in host:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue