summaryrefslogtreecommitdiff
path: root/archaeological_operations/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-12 16:18:57 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-12 16:18:57 +0100
commitf1dc9dbfed7cc90899f9975c29091a61e63fcb02 (patch)
treed7f34f347aa533855990da473b17fc35f5bb1878 /archaeological_operations/wizards.py
parentce0947a6b35bb0ef3a12fe6c07efaa074317fe4b (diff)
downloadIshtar-f1dc9dbfed7cc90899f9975c29091a61e63fcb02.tar.bz2
Ishtar-f1dc9dbfed7cc90899f9975c29091a61e63fcb02.zip
Fix pin and unpi for administrativ acts
Diffstat (limited to 'archaeological_operations/wizards.py')
-rw-r--r--archaeological_operations/wizards.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index b0708f2db..de38beb95 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -395,8 +395,13 @@ class OperationAdministrativeActWizard(OperationWizard):
dct['redirect'] = reverse('generatedoc-administrativeactop',
args=[admact.pk, r[0]])
# make the new object a default
- self.request.session[self.current_obj_slug] = unicode(admact.pk)
- self.request.session[self.get_object_name(admact)] = unicode(admact.pk)
+ ishtaruser = self.request.user.ishtaruser \
+ if hasattr(self.request.user, 'ishtaruser') else None
+ if ishtaruser and ishtaruser.current_profile \
+ and ishtaruser.current_profile.auto_pin:
+ self.request.session[self.current_obj_slug] = unicode(admact.pk)
+ self.request.session[self.get_object_name(admact)] = unicode(
+ admact.pk)
res = render(self.request, 'ishtar/wizard/wizard_done.html', dct)
return res