[Bugfix] Terminal status报异常

pull/828/merge
ibuler 7 years ago
parent 15f6d5c9c0
commit ffa7e58025

@ -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

Loading…
Cancel
Save