Render batch execution description as markdown

This commit is contained in:
Lance Edgar 2021-02-09 14:21:07 -06:00
parent cc2308c399
commit 5969515f25
2 changed files with 16 additions and 4 deletions

View file

@ -38,6 +38,7 @@ from six import StringIO
import json
import six
import markdown
import sqlalchemy as sa
from sqlalchemy import orm
@ -175,6 +176,10 @@ class BatchMasterView(MasterView):
if kwargs['execute_enabled']:
url = self.get_action_url('execute', batch)
kwargs['execute_form'] = self.make_execute_form(batch, action_url=url)
description = (self.handler.describe_execution(batch)
or "TODO: handler does not provide a description for this batch")
kwargs['execution_described'] = markdown.markdown(
description, extensions=['fenced_code', 'codehilite'])
else:
kwargs['why_not_execute'] = self.handler.why_not_execute(batch)