Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#5354 closed defect (fixed)

Graveyard media don't return serializable timestamps

Reported by: ayleph Owned by:
Priority: critical Milestone: 0.9.0
Component: programming Keywords: api, json, graveyard
Cc: tsyesika Parent Tickets:


Entries in core__graveyard don't return a serializable JSON timestamp, resulting in failures of pump clients. The below patch addresses this issue.

From 7782960e044b9a366ac46cfaf687af4fceb17c3e Mon Sep 17 00:00:00 2001
From: ayleph <>
Date: Sat, 31 Oct 2015 03:04:06 -0400
Subject: [PATCH] Return deleted time in serializable format

 mediagoblin/db/ | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mediagoblin/db/ b/mediagoblin/db/
index 6765955..0de14b4 100644
--- a/mediagoblin/db/
+++ b/mediagoblin/db/
@@ -1562,13 +1562,14 @@ class Graveyard(Base):
     def serialize(self, request):
+        deleted = UTC.localize(self.deleted)
         return {
             "id": self.public_id,
             "objectType": self.object_type,
-            "published": self.deleted,
-            "updated": self.deleted,
-            "deleted": self.deleted
+            "published": deleted.isoformat(),
+            "updated": deleted.isoformat(),
+            "deleted": deleted.isoformat()
 MODELS = [ 

Change History (6)

comment:1 by ayleph, 9 years ago

Status: newreview

comment:2 by ayleph, 9 years ago

Milestone: 0.8.1

comment:3 by Christopher Allan Webber, 9 years ago

Let's have Jessica review this one when she gets back next week.

comment:4 by ayleph, 9 years ago

Okay with me. I neglected to mention this in the ticket, but I copied the style of handling datetime objects (UTC.localize & isoformat) from serialize functions of the other classes, so it's all consistent with current programming.

comment:5 by Jessica Tallon, 9 years ago

Resolution: fixed
Status: reviewclosed

This has been fixed with commit 89068c2. Thanks Alyeph.

comment:6 by Christopher Allan Webber, 8 years ago


All 0.8.2 tickets are being rolled over to 0.9.0

Note: See TracTickets for help on using tickets.