Add static pump_io to API and fix problem where null appeared in profile

This commit is contained in:
Jessica Tallon 2013-09-04 16:32:49 +01:00 committed by Jessica Tallon
parent d6dce0f7d8
commit c434fc31c9

View File

@ -143,8 +143,10 @@ class User(Base, UserMixin):
"preferredUsername": self.username, "preferredUsername": self.username,
"displayName": "{0}@{1}".format(self.username, request.host), "displayName": "{0}@{1}".format(self.username, request.host),
"objectType": "person", "objectType": "person",
"url": self.url, "pump_io": {
"summary": self.bio, "shared": False,
"followed": False,
},
"links": { "links": {
"self": { "self": {
"href": request.urlgen( "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 return user
class Client(Base): class Client(Base):
@ -458,6 +466,9 @@ class MediaEntry(Base, MediaEntryMixin):
}, },
"published": self.created.isoformat(), "published": self.created.isoformat(),
"updated": self.created.isoformat(), "updated": self.created.isoformat(),
"pump_io": {
"shared": False,
},
} }
if show_comments: if show_comments: