Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
Problem: tasks API ommits error field in response
Browse files Browse the repository at this point in the history
Solution: update the serializer for Task model by renaming 'result' field to 'error'

closes #2787
  • Loading branch information
dkliban committed Jun 1, 2017
1 parent 7f57d17 commit 12d36be
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions platform/pulp/app/serializers/task.py
Expand Up @@ -43,12 +43,14 @@ class TaskSerializer(ModelSerializer):
)

non_fatal_errors = serializers.JSONField(
help_text=_("A JSON Object of errors encountered during the execution of this task."),
help_text=_("A JSON Object of non-fatal errors encountered during the execution of this "
"task."),
read_only=True
)

result = serializers.JSONField(
help_text=_("A JSON Object of what this task returned (if any)."),
error = serializers.JSONField(
help_text=_("A JSON Object of a fatal error encountered during the execution of this "
"task."),
read_only=True
)

Expand All @@ -75,7 +77,7 @@ class Meta:
model = models.Task
fields = ModelSerializer.Meta.fields + ('group', 'state', 'started_at',
'finished_at', 'non_fatal_errors',
'result', 'worker', 'parent', 'tags')
'error', 'worker', 'parent', 'tags')


class WorkerSerializer(ModelSerializer):
Expand Down

0 comments on commit 12d36be

Please sign in to comment.