From 702e575ecf8c24b1a4ffd3475168d9cbe0433daa Mon Sep 17 00:00:00 2001 From: Chris Church Date: Wed, 26 Mar 2014 16:18:47 -0400 Subject: [PATCH] Return elapsed as number instead of string for unified job subclasses. --- awx/api/serializers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 86901e94b6..5ee8d6c341 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -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):