allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [3/3] allura git commit: [#8077] Added icon_url in API response
Date Mon, 23 May 2016 15:14:09 GMT
[#8077] Added icon_url in API response


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/665a1a24
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/665a1a24
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/665a1a24

Branch: refs/heads/master
Commit: 665a1a24c4aa2e5fec2890590a3b46432aa07cbb
Parents: 212c359
Author: Rohan Verma <rohanverma2004@gmail.com>
Authored: Wed May 18 02:05:44 2016 +0530
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon May 23 11:04:53 2016 -0400

----------------------------------------------------------------------
 Allura/allura/model/artifact.py | 4 ++++
 Allura/allura/model/discuss.py  | 1 +
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/665a1a24/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 0d177ce..ba3912a 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -682,6 +682,10 @@ class Message(Artifact):
         from .auth import User
         return User.query.get(_id=self.author_id) or User.anonymous()
 
+    def icon_url(self):
+        from .auth import User
+        return User.query.get(_id=self.author_id).icon_url()
+
     def index(self):
         result = Artifact.index(self)
         author = self.author()

http://git-wip-us.apache.org/repos/asf/allura/blob/665a1a24/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 36dc160..65797fe 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -200,6 +200,7 @@ class Thread(Artifact, ActivityObject):
                         text=p.text,
                         subject=p.subject,
                         author=p.author().username,
+                        icon_url=p.icon_url(),
                         timestamp=p.timestamp,
                         last_edited=p.last_edit_date,
                         attachments=self.attachment_for_export(p) if is_export else self.attachemtns_for_json(p))


Mime
View raw message