From 97f43cba1ba5204f2da685c04aed5770ff3d68a8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 4 Dec 2018 11:15:44 +0100 Subject: Fix wizard permissions call --- ishtar_common/forms.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ishtar_common/forms.py') diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 0c93016b1..b27d4cf4d 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -745,8 +745,11 @@ class QAForm(CustomForm, ManageOldType): elif hasattr(self.fields[k], "choices"): values = [] for v in kwargs['data'].getlist(k): - values.append( - dict(self.fields[k].choices)[int(v)]) + dct_choices = dict(self.fields[k].choices) + if v in dct_choices: + values.append(dct_choices[v]) + elif int(v) in dct_choices: + values.append(dct_choices[int(v)]) self.fields[k].rendered_value = mark_safe( u" ; ".join(values)) if k not in self.REPLACE_FIELDS: -- cgit v1.2.3