From 87cfd39b7f4117c25c1c12856ee5932f2fecf3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Sun, 31 Aug 2014 22:58:30 +0200 Subject: [PATCH] =?UTF-8?q?[gest=5Fcrans]=20Quand=20on=20d=C3=A9truit=20un?= =?UTF-8?q?=20adh=C3=A9rent,=20il=20faut=20=C3=A9viter=20de=20locker=20ses?= =?UTF-8?q?=20machines.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestion/gest_crans.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index 41109289..8fe3e6fb 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -693,8 +693,8 @@ def del_adher(adher): quoi = u'Toutes les machines associées à cet adhérent seront détruites' if adher._data.get('uid', '') != '': # L'adhérent a un compte - machines = adher.machines() - if not machines: + has_machines = (adher.machines() != []) + if not has_machines: quoi = u'Le compte de cet adhérent sera détruit' else: # Et aussi des machines @@ -716,7 +716,7 @@ def del_adher(adher): arg += u'--inputbox "\Zr\Z1ATTENTION\Zn : la destruction est définitive\nToutes les machines associées à cet adhérent seront détruites, seul le compte sera conservé.\nCommentaire à insérer ?" 0 0' annul, res = dialog(arg) if annul: return 1 - for m in machines: + for m in adher.machines(): m.delete(res[0]) adher.chbre('EXT') arg = u'--title "Destruction machines" '