Only show "toggle complete" buttons when viewing batch

i.e. just show simple value for e.g. delete batch page
This commit is contained in:
Lance Edgar 2018-05-23 13:28:11 -05:00
parent 6d27d0cfba
commit 62dca3d0b0

View file

@ -242,7 +242,8 @@ class BatchMasterView(MasterView):
f.set_label('status_code', "Status") f.set_label('status_code', "Status")
# complete # complete
f.set_renderer('complete', self.render_complete) if self.viewing:
f.set_renderer('complete', self.render_complete)
# executed # executed
f.set_readonly('executed') f.set_readonly('executed')
@ -289,7 +290,8 @@ class BatchMasterView(MasterView):
content = [HTML.literal("Yes" if batch.complete else "No")] content = [HTML.literal("Yes" if batch.complete else "No")]
if not batch.executed: if not batch.executed:
if self.request.has_perm('{}.edit'.format(self.get_permission_prefix())): permission_prefix = self.get_permission_prefix()
if self.request.has_perm('{}.edit'.format(permission_prefix)):
if batch.complete: if batch.complete:
label = "Mark as NOT Complete" label = "Mark as NOT Complete"