Si il n'y a pas de suffixe, on le rajoute pour eviter les prb

This commit is contained in:
Gabriel Detraz 2015-11-13 17:36:46 +01:00
parent f943cf52a6
commit 28cfce0916
2 changed files with 3 additions and 3 deletions

View file

@ -363,10 +363,10 @@ class Dialog(proprio.Dialog):
new_debutconnexion = max(now, finconnexion)
con_month = new_debutconnexion.month
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:
t_end_adh = finadhesion.value()
t_end_adh = finadhesion.value
t_end_conn = finconnexion
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))

View file

@ -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)
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)]:
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: