diff --git a/gestion/dialog/adherent.py b/gestion/dialog/adherent.py index ecf4fb56..768c6ff4 100644 --- a/gestion/dialog/adherent.py +++ b/gestion/dialog/adherent.py @@ -9,6 +9,7 @@ Licence : GPLv3 import sys import time import datetime +import subprocess import dateutil.relativedelta if '/usr/scripts' not in sys.path: sys.path.append('/usr/scripts') @@ -589,6 +590,12 @@ class Dialog(proprio.Dialog): if self.confirm_item(adherent, title="Créer l'adhérent suivant ?"): adherent.validate_changes() adherent.create() + if self.dialog.yesno("Imprimer un ticket avec un mot de passe attribué automatiquement ?", + title="Impression de ticket pour %s %s" % (adherent.get('prenom', [''])[0], adherent["nom"][0]), + timeout=self.timeout + ) == self.dialog.DIALOG_OK: + subprocess.call(['/usr/scripts/cransticket/dump_creds.py', '--forced', '--pass', 'aid=%s' % adherent['aid'][0]]) + self.display_item(adherent, "Impression du ticket en cours ...") else: adherent = None return adherent diff --git a/gestion/dialog/proprio.py b/gestion/dialog/proprio.py index ca6ef392..240e4aa6 100644 --- a/gestion/dialog/proprio.py +++ b/gestion/dialog/proprio.py @@ -85,11 +85,10 @@ class Dialog(machine.Dialog, blacklist.Dialog): @tailcaller def set_password(proprio, update_obj, cont): - if self.dialog.yesno("Attribuer un mot de passe maintenant ?", + if self.dialog.yesno("Attribuer un mot de passe maintenant ? (Vous aurez la possibilité d'imprimer un ticket plus tard également ...)", title="Création du compte de %s %s" % (proprio.get('prenom', [''])[0], proprio["nom"][0]), timeout=self.timeout ) == self.dialog.DIALOG_OK: - #return self.proprio_compte_password(proprio=proprio, return_obj=return_obj, cont=cont(**{update_obj:proprio})) proprio = self.proprio_compte_password(proprio=proprio, return_obj=True, cont=TailCall(set_password, proprio, update_obj, cont)) if return_obj: return proprio