From 12e024dc63c7faaf7530565b7c3308ca962a65fb Mon Sep 17 00:00:00 2001 From: Nicolas Dandrimont Date: Sat, 13 Sep 2008 12:48:19 +0200 Subject: [PATCH] Un nom de machine ne peut finir par '-' darcs-hash:20080913104819-ffbb2-6b2eda9d0cd8b7db4788e5eb48025c2ce5a2fc3a.gz --- gestion/ldap_crans.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 4d962bea..fd552d2f 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2663,6 +2663,9 @@ class Machine(BaseClasseCrans): if not new[0].isalpha(): raise ValueError(u"Le premier caractère du champ %s doit être alphabétique" % champ) + if new.endswith('-'): + raise ValueError(u"Le dernier caractère du champ %s ne peut être un tiret" % champ) + # Ajout du domaine si necessaire if new.find('.') == -1: try: