diff options
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r-- | ishtar_common/forms.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index c7e3fe38c..cfdd531d9 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -824,10 +824,15 @@ class QAForm(CustomForm, ManageOldType): elif hasattr(self.fields[k], "choices"): values = [] for v in kwargs['data'].getlist(k): - dct_choices = dict(self.fields[k].choices) - if v in dct_choices: + dct_choices = {} + for key, value in self.fields[k].choices: + if isinstance(value, (list, tuple)): + dct_choices.update(value) + else: + dct_choices[key] = value + if v in list(dct_choices.keys()): values.append(unicode(dct_choices[v])) - elif int(v) in dct_choices: + elif int(v) in list(dct_choices.keys()): values.append(unicode(dct_choices[int(v)])) self.fields[k].rendered_value = mark_safe( u" ; ".join(values)) |