From c434fc31c9b4195dabfb9c323bf13aca3337e5f9 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Wed, 4 Sep 2013 16:32:49 +0100 Subject: [PATCH] Add static pump_io to API and fix problem where null appeared in profile --- mediagoblin/db/models.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 4f5182d6..cc22450f 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -143,8 +143,10 @@ class User(Base, UserMixin): "preferredUsername": self.username, "displayName": "{0}@{1}".format(self.username, request.host), "objectType": "person", - "url": self.url, - "summary": self.bio, + "pump_io": { + "shared": False, + "followed": False, + }, "links": { "self": { "href": request.urlgen( @@ -169,6 +171,12 @@ class User(Base, UserMixin): }, }, } + + if self.bio: + user.update({"summary": self.bio}) + if self.url: + user.update({"url": self.url}) + return user class Client(Base): @@ -458,6 +466,9 @@ class MediaEntry(Base, MediaEntryMixin): }, "published": self.created.isoformat(), "updated": self.created.isoformat(), + "pump_io": { + "shared": False, + }, } if show_comments: