From efdbc3c5b5fc17dd84ebb05def0362877c57c22b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 26 Jan 2018 19:04:34 -0600 Subject: [PATCH] Show "buttons" when viewing an object, with forms2 also tweak logic when creating a batch..we'll see if it works.. --- tailbone/templates/forms2/form_readonly.mako | 6 +++--- tailbone/views/batch/core3.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tailbone/templates/forms2/form_readonly.mako b/tailbone/templates/forms2/form_readonly.mako index ed61a44e..306282e9 100644 --- a/tailbone/templates/forms2/form_readonly.mako +++ b/tailbone/templates/forms2/form_readonly.mako @@ -2,7 +2,7 @@
${form.render_deform(readonly=True)|n} -## % if buttons: -## ${buttons|n} -## % endif + % if buttons: + ${buttons|n} + % endif
diff --git a/tailbone/views/batch/core3.py b/tailbone/views/batch/core3.py index d668a96a..07fb039f 100644 --- a/tailbone/views/batch/core3.py +++ b/tailbone/views/batch/core3.py @@ -120,9 +120,11 @@ class BatchMasterView3(MasterView3, BatchMasterView2): # current user is batch creator batch.created_by = self.request.user or self.late_login_user() + # TODO: is this still necessary with colander? # destroy initial batch and re-make using handler kwargs = self.get_batch_kwargs(batch) - self.Session.expunge(batch) + # if batch in self.Session: + # self.Session.expunge(batch) batch = self.handler.make_batch(self.Session(), **kwargs) self.Session.flush()