Merge "Use playbook.updated instead of "now" for calculating duration"

This commit is contained in:
Zuul 2018-10-17 15:31:47 +00:00 committed by Gerrit Code Review
commit da5af07d3d
1 changed files with 1 additions and 2 deletions

View File

@ -20,7 +20,6 @@ import json
import logging
import zlib
from django.utils import timezone
from rest_framework import serializers
from ara.api import models
@ -70,7 +69,7 @@ class DurationSerializer(serializers.ModelSerializer):
@staticmethod
def get_duration(obj):
if obj.ended is None:
return timezone.now() - obj.started
return obj.updated - obj.started
return obj.ended - obj.started