Merge pull request #1166 from ryanpetrello/fix-system-job-stdout

properly handle STDOUT_MAX_BYTES_DISPLAY for system jobs
This commit is contained in:
Ryan Petrello
2018-02-08 13:55:59 -05:00
committed by GitHub
2 changed files with 26 additions and 1 deletions

View File

@@ -2968,7 +2968,14 @@ class SystemJobSerializer(UnifiedJobSerializer):
return res
def get_result_stdout(self, obj):
return obj.result_stdout
try:
return obj.result_stdout
except StdoutMaxBytesExceeded as e:
return _(
"Standard Output too large to display ({text_size} bytes), "
"only download supported for sizes over {supported_size} bytes").format(
text_size=e.total, supported_size=e.supported
)
class SystemJobCancelSerializer(SystemJobSerializer):