Fix #1040 - Comments should have published attribute
authorJessica Tallon <jessica@megworld.co.uk>
Thu, 27 Nov 2014 10:12:53 +0000 (10:12 +0000)
committerJessica Tallon <jessica@megworld.co.uk>
Thu, 27 Nov 2014 10:13:21 +0000 (10:13 +0000)
mediagoblin/db/models.py

index 8f722cff456bb420951637b55d97b1cd90c7dc97..7afd428d98c6ba8b5ce0d626982581c0a93a02f0 100644 (file)
@@ -769,12 +769,15 @@ class MediaComment(Base, MediaCommentMixin):
         )
         media = MediaEntry.query.filter_by(id=self.media_entry).first()
         author = self.get_author
+        published = UTC.localize(self.created)
         context = {
             "id": href,
             "objectType": self.object_type,
             "content": self.content,
             "inReplyTo": media.serialize(request, show_comments=False),
-            "author": author.serialize(request)
+            "author": author.serialize(request),
+            "published": published.isoformat(),
+            "updated": published.isoformat(),
         }
 
         if self.location: