Return consistent date formats in API

This commit is contained in:
Tomasz Wójcik 2017-06-28 13:02:11 +02:00 committed by GitHub
parent 7faf53d71f
commit 27f917ce02

View File

@ -167,8 +167,8 @@ class Check(models.Model):
result["tz"] = self.tz
if self.last_ping:
result["last_ping"] = self.last_ping.isoformat()
result["next_ping"] = (self.last_ping + self.timeout).isoformat()
result["last_ping"] = self.last_ping.replace(microsecond=0).isoformat()
result["next_ping"] = (self.last_ping + self.timeout).replace(microsecond=0).isoformat()
else:
result["last_ping"] = None
result["next_ping"] = None