From b7ceb88051c5c0d2449d8362a3187107553f21f7 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 23 Mar 2014 20:36:53 +0100 Subject: [PATCH] =?UTF-8?q?[attributs]=20Enfor=C3=A7age=20de=20la=20valeur?= =?UTF-8?q?e=20de=20modePaiement=20=C3=A0=20une=20liste=20pr=C3=A9d=C3=A9f?= =?UTF-8?q?inie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- attributs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/attributs.py b/attributs.py index cf7f212..bd2175a 100644 --- a/attributs.py +++ b/attributs.py @@ -1447,6 +1447,12 @@ class modePaiement(Attr): singlevalue = True ldap_name = "modePaiement" + def parse_value(self, mode): + if not mode in config.modePaiement: + raise ValueError("%s n'est pas un moyen de paiement accepté. Les moyens accepté sont %s" % ", ".join(config.modePaiement)) + self.value = mode + self.parent._frais(mode) + @crans_attribute class recuPaiement(Attr): ldap_name = "recuPaiement"