Graveyard media don't return serializable timestamps
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 <ayleph@thisshitistemp.com>
Date: Sat, 31 Oct 2015 03:04:06 -0400
Subject: [PATCH] Return deleted time in serializable format
---
mediagoblin/db/models.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index 6765955..0de14b4 100644
--- a/mediagoblin/db/models.py
+++ b/mediagoblin/db/models.py
@@ -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,
"actor": self.actor(),
- "published": self.deleted,
- "updated": self.deleted,
- "deleted": self.deleted
+ "published": deleted.isoformat(),
+ "updated": deleted.isoformat(),
+ "deleted": deleted.isoformat()
}
MODELS = [
--
2.6.2
Change History
(6)
Resolution: |
→ fixed
|
Status: |
review → closed
|
Let's have Jessica review this one when she gets back next week.