Merge branch 'new_api' into ops

pull/828/merge
ibuler 2017-12-13 18:10:41 +08:00
commit 160b01ec12
1 changed files with 4 additions and 1 deletions

View File

@ -23,7 +23,10 @@ class TerminalSerializer(serializers.ModelSerializer):
@staticmethod
def get_is_alive(obj):
status = obj.status_set.latest()
try:
status = obj.status_set.latest()
except Status.DoesNotExist:
status = None
if not status:
return False