aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Tallon <zslrd@inboxen.co.uk>2013-09-04 16:32:49 +0100
committerJessica Tallon <jessica@megworld.co.uk>2014-07-22 23:13:14 +0100
commitc434fc31c9b4195dabfb9c323bf13aca3337e5f9 (patch)
tree6488a4deaa09ef2ebb45b1cc92d282e22b9ccdad
parentd6dce0f7d8cda420c632334251203392055fb716 (diff)
downloadmediagoblin-c434fc31c9b4195dabfb9c323bf13aca3337e5f9.tar.lz
mediagoblin-c434fc31c9b4195dabfb9c323bf13aca3337e5f9.tar.xz
mediagoblin-c434fc31c9b4195dabfb9c323bf13aca3337e5f9.zip
Add static pump_io to API and fix problem where null appeared in profile
-rw-r--r--mediagoblin/db/models.py15
1 files 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: