Chnange 'status' field in response to 'up'

This commit is contained in:
James Kirsop 2020-06-12 09:16:20 +10:00
parent bc6ccd55b3
commit 4b1b232959

View File

@ -241,7 +241,7 @@ class Check(models.Model):
owner=self, new_status__in=("down","up"), created__gt=cutoff
).order_by("created")
dictStatus = {"up":1,"down":0}
result['history'] = list(map(lambda x: {'timestamp':x.created,'status':dictStatus[x.new_status]}, flips))
result['history'] = list(map(lambda x: {'timestamp':x.created,'up':dictStatus[x.new_status]}, flips))
if readonly:
result["unique_key"] = self.unique_key
else: