1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Return elapsed as number instead of string for unified job subclasses.

This commit is contained in:
Chris Church 2014-03-26 16:18:47 -04:00
parent bfb0159083
commit 702e575ecf

View File

@ -322,6 +322,12 @@ class UnifiedJobSerializer(BaseSerializer):
res['schedule'] = obj.schedule.get_absolute_url()
return res
def to_native(self, obj):
ret = super(UnifiedJobSerializer, self).to_native(obj)
if 'elapsed' in ret:
ret['elapsed'] = float(ret['elapsed'])
return ret
class BaseTaskSerializer(BaseSerializer):