summaryrefslogtreecommitdiff
path: root/ishtar_common/wizards.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r--ishtar_common/wizards.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 499f008b4..d0a7df84b 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -906,10 +906,13 @@ class Wizard(IshtarWizard):
# post save/m2m specific fix
obj.fix()
- # make the new object a default
- if self.current_obj_slug:
- self.request.session[self.current_obj_slug] = unicode(obj.pk)
- self.request.session[self.get_object_name(obj)] = unicode(obj.pk)
+ ishtaruser = self.request.user.ishtaruser \
+ if hasattr(self.request.user, 'ishtaruser') else None
+ if ishtaruser and ishtaruser.current_profile.auto_pin:
+ # make the new object a default
+ if self.current_obj_slug:
+ self.request.session[self.current_obj_slug] = unicode(obj.pk)
+ self.request.session[self.get_object_name(obj)] = unicode(obj.pk)
dct = {'item': obj}
self.current_object = obj
# force evaluation of lazy urls
@@ -1384,8 +1387,11 @@ class Wizard(IshtarWizard):
current_step = step or self.steps.current
c_form = self.form_list[current_step]
- # make the current object the default item for the session
- self.request.session[self.get_object_name(obj)] = unicode(obj.pk)
+ ishtaruser = self.request.user.ishtaruser \
+ if hasattr(self.request.user, 'ishtaruser') else None
+ if ishtaruser and ishtaruser.current_profile.auto_pin:
+ # make the current object the default item for the session
+ self.request.session[self.get_object_name(obj)] = unicode(obj.pk)
initial = MultiValueDict()
# posted data or already in session