Skip to content

Commit

Permalink
Apply user error filter to stderr of jobs when showing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvanrun committed Jan 24, 2025
1 parent a419c9e commit 7573806
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% load log_filter %}

{% if object.status == object.SUCCESS and object.stderr %}
<div>
<div class="modal"
Expand All @@ -18,7 +20,7 @@ <h5 class="modal-title">
</button>
</div>
<div class="text-left modal-body">
{{ object.stderr }}
{{ object.stderr | user_error | truncatechars:1024 }}
</div>
<div class="modal-footer">
<a class="btn btn-primary" href="{{ object.get_absolute_url }}">
Expand Down
12 changes: 12 additions & 0 deletions app/grandchallenge/components/templatetags/log_filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django import template

from grandchallenge.components.backends.utils import (
user_error as component_user_error,
)

register = template.Library()


@register.filter
def user_error(arg):
return component_user_error(arg)

0 comments on commit 7573806

Please sign in to comment.