From c70af314a07f8b1ad84cf8b55806714ed408b6f1 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 8 Feb 2016 02:31:55 +0100 Subject: Fix default item after creations --- archaeological_operations/wizards.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'archaeological_operations/wizards.py') diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index 2e7b3c4b4..6e512e826 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -329,6 +329,7 @@ class OperationSourceDeletionWizard(DeletionWizard): class OperationAdministrativeActWizard(OperationWizard): edit = False wizard_done_window = reverse_lazy('show-administrativeact') + current_obj_slug = 'administrativeactop' def get_reminder(self): form_key = 'selec-' + self.url_name @@ -416,6 +417,9 @@ class OperationAdministrativeActWizard(OperationWizard): if r and r[0]: 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) res = render_to_response('ishtar/wizard/wizard_done.html', dct, context_instance=RequestContext(self.request)) -- cgit v1.2.3