From 91fc1359b02b0a8b6d665865a3df1f3251b4e44d Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Tue, 2 Dec 2014 20:42:54 +0100 Subject: [PATCH] =?UTF-8?q?[dialog]=20On=20transmet=20l'objet=20proprio=20?= =?UTF-8?q?=C3=A9diter=20au=20menu=20parent=20en=20quittant=20le=20menu=20?= =?UTF-8?q?compte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestion/dialog/adherent.py | 2 +- gestion/dialog/proprio.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gestion/dialog/adherent.py b/gestion/dialog/adherent.py index f3bd2a9c..5c9e29a1 100644 --- a/gestion/dialog/adherent.py +++ b/gestion/dialog/adherent.py @@ -54,7 +54,7 @@ class Dialog(proprio.Dialog): 'Personnel' : {'text' : "Nom, prénom, téléphone... (ajouter l'age ?)", 'callback':self.adherent_personnel}, 'Études' : {'text' : "Étude en cours", "callback":self.adherent_etudes}, 'Chambre' : {'text' : 'Déménagement', "callback":self.adherent_chambre}, - 'Compte' : {'text' : "Gestion du compte crans", "adherent":"proprio", "callback":self.proprio_compte, 'help':"Création/Suppression/Activation/Désactivation du compte, gestion des alias mails crans du compte"}, + 'Compte' : {'text' : "Gestion du compte crans", "adherent":"proprio", "callback":TailCall(self.proprio_compte, update_obj='adherent'), 'help':"Création/Suppression/Activation/Désactivation du compte, gestion des alias mails crans du compte"}, 'GPGFingerprint' : {'text':'Ajouter ou supprimer une empeinte GPG', 'attribut':attributs.gpgFingerprint}, 'Remarques' : {'text':'Ajouter ou supprimer une remarque de la machine', 'attribut':attributs.info}, 'Droits' : {'text':"Modifier les droits alloués à cet adhérent", "callback":self.adherent_droits}, diff --git a/gestion/dialog/proprio.py b/gestion/dialog/proprio.py index ed67c0df..8c7a01e7 100644 --- a/gestion/dialog/proprio.py +++ b/gestion/dialog/proprio.py @@ -279,7 +279,7 @@ class Dialog(machine.Dialog, blacklist.Dialog): codes_todo=[([self.dialog.DIALOG_OK], todo, [output, shell, shells, proprio, self_cont, cont])] ) - def proprio_compte(self, proprio, cont, default_item=None): + def proprio_compte(self, proprio, cont, default_item=None, update_obj='proprio'): """Menu de gestion du compte crans d'un proprio""" has_compte = 'cransAccount' in proprio['objectClass'] disabled_compte = has_compte and 0 in proprio['shadowExpire'] @@ -347,8 +347,9 @@ class Dialog(machine.Dialog, blacklist.Dialog): raise EnvironmentError("Il n'y a ni champ 'attribut' ni 'callback' pour le tag %s" % tag) + cont(**{update_obj:proprio}) (code, tag) = self.handle_dialog(cont, box, default_item) - self_cont = TailCall(self.proprio_compte, proprio=proprio, cont=cont, default_item=tag_translate.get(tag, tag)) + self_cont = TailCall(self.proprio_compte, proprio=proprio, cont=cont, default_item=tag_translate.get(tag, tag), update_obj=update_obj) return self.handle_dialog_result( code=code, output=tag,