From 637b966ac20e448d17b310ccbf29389410d7cdf2 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Mon, 29 Jul 2013 17:31:42 +0100 Subject: [PATCH] Adds seralize on user --- mediagoblin/db/models.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index 4c9345fc..b96129ae 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -136,6 +136,16 @@ class User(Base, UserMixin): return UserBan.query.get(self.id) is not None + def serialize(self, request): + user = { + "preferredUsername": self.username, + "displayName": "{username}@{server}".format(username=self.username, server=request.url) + "objectType": "person", + "url": self.url, + "links": { + }, + } + class Client(Base): """ Model representing a client - Used for API Auth -- 2.25.1