summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/forms.py7
-rw-r--r--ishtar_common/wizards.py4
2 files changed, 7 insertions, 4 deletions
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:
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 446afc71e..47355dd06 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -147,7 +147,7 @@ class Wizard(IshtarWizard):
form, other_check)
return kwargs
- def check_own_permissions(self, request, step, *args, **kwargs):
+ def check_own_permissions(self, request, step=None, *args, **kwargs):
# reinit default dispatch of a wizard - not clean...
self.request = request
self.session = request.session
@@ -179,7 +179,7 @@ class Wizard(IshtarWizard):
step = kwargs.get('step', None)
# check that the current object is really owned by the current user
if step and self.current_right and '_own_' in self.current_right:
- if not self.check_permissions(request, step, *args, **kwargs):
+ if not self.check_own_permissions(request, *args, **kwargs):
return HttpResponseRedirect('/')
# extra filter on forms
self.filter_owns_items = True