Fix some things for inventory batch views

This commit is contained in:
Lance Edgar 2018-05-23 14:13:28 -05:00
parent 62dca3d0b0
commit 57c2a7981f
2 changed files with 3 additions and 4 deletions
tailbone/views/batch

View file

@ -445,7 +445,9 @@ class BatchMasterView(MasterView):
def toggle_complete(self):
batch = self.get_instance()
if not batch.executed:
if batch.executed:
self.request.session.flash("Request ignored, since batch has already been executed")
else:
form = forms.Form(schema=ToggleComplete(), request=self.request)
if form.validate(newstyle=True):
batch.complete = form.validated['complete']