diff --git a/app/portal/automation.py b/app/portal/automation.py index 4f60a2c..a33b911 100644 --- a/app/portal/automation.py +++ b/app/portal/automation.py @@ -8,7 +8,7 @@ from sqlalchemy import exc from wtforms import SubmitField, BooleanField from app.extensions import db -from app.models.automation import Automation +from app.models.automation import Automation, AutomationLogs from app.portal.util import view_lifecycle, response_404 bp = Blueprint("automation", __name__) @@ -58,8 +58,10 @@ def automation_edit(automation_id: int) -> ResponseReturnValue: flash("Saved changes to bridge configuration.", "success") except exc.SQLAlchemyError: flash("An error occurred saving the changes to the bridge configuration.", "danger") + logs = AutomationLogs.query.filter(AutomationLogs.automation_id == automation.id).order_by(AutomationLogs.added).all() return render_template("automation.html.j2", automation=automation, + logs=logs, form=form, **_SECTION_TEMPLATE_VARS) diff --git a/app/portal/templates/automation.html.j2 b/app/portal/templates/automation.html.j2 index 1917520..f79c08c 100644 --- a/app/portal/templates/automation.html.j2 +++ b/app/portal/templates/automation.html.j2 @@ -11,6 +11,6 @@

Logs

- {{ automation_logs_table(automation.logs) }} + {{ automation_logs_table(logs) }} {% endblock %} diff --git a/app/portal/templates/tables.html.j2 b/app/portal/templates/tables.html.j2 index baa81ae..614e81a 100644 --- a/app/portal/templates/tables.html.j2 +++ b/app/portal/templates/tables.html.j2 @@ -167,7 +167,7 @@ {% for log in logs %} {{ log.added | format_datetime }} - {{ log.logs }} +
{{ log.logs | e }}
{% endfor %} @@ -596,4 +596,4 @@ -{% endmacro %} \ No newline at end of file +{% endmacro %}