incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [25/40] git commit: [#6716] Fixed non-deinstrumented values in __json__ methods
Date Wed, 30 Oct 2013 17:00:43 GMT
[#6716] Fixed non-deinstrumented values in __json__ methods

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/cj/6777
Commit: 47a241c19564a47859de503adebefed24bdeeee2
Parents: 6352551
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Wed Oct 23 20:53:26 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Oct 25 21:07:48 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/artifact.py           |  4 ++--
 Allura/allura/model/project.py            | 13 +++++++------
 ForgeBlog/forgeblog/model/blog.py         |  2 +-
 ForgeTracker/forgetracker/model/ticket.py |  2 +-
 ForgeWiki/forgewiki/model/wiki.py         |  2 +-
 5 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/47a241c1/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index 084ed9e..5b288d5 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -100,9 +100,9 @@ class Artifact(MappedClass):
         return dict(
             _id=str(self._id),
             mod_date=self.mod_date,
-            labels=self.labels,
+            labels=list(self.labels),
             related_artifacts=[a.url() for a in self.related_artifacts()],
-            discussion_thread=self.discussion_thread,
+            discussion_thread=self.discussion_thread.__json__(),
             discussion_thread_url=h.absurl('/rest%s' % self.discussion_thread.url()),
         )
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/47a241c1/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 5ac1810..b9d310c 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -886,22 +886,23 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         return dict(
             shortname=self.shortname,
             name=self.name,
-            _id=self._id,
+            _id=str(self._id),
             url=h.absurl(self.url()),
             private=self.private,
             short_description=self.short_description,
             summary=self.summary,
             external_homepage=self.external_homepage,
-            socialnetworks=self.socialnetworks,
+            socialnetworks=[dict(n) for n in self.socialnetworks],
             status=self.removal or 'active',
             moved_to_url=self.moved_to_url,
             preferred_support_tool=self.support_page,
             preferred_support_url=self.support_page_url,
-            developers=self.users_with_role('Developer'),
+            developers=[u.__json__() for u in self.users_with_role('Developer')],
             tools=[dict(name=t.tool_name, mount_point=t.options.mount_point, label=t.options.mount_label)
                    for t in self.app_configs if h.has_access(t, 'read')],
-            labels=self.labels,
-            categories=self.all_troves(),
+            labels=list(self.labels),
+            categories={
+                n: [t.__json__() for t in ts] for n, ts in self.all_troves().items()},
             icon_url=h.absurl(self.url() + 'icon') if self.icon else None,
             screenshots = [
                 dict(
@@ -982,5 +983,5 @@ class AppConfig(MappedClass):
     def __json__(self):
         return dict(
             _id=self._id,
-            options=dict(self.options),  # strip away the ming instrumentation
+            options=self.options._deinstrument(),  # strip away the ming instrumentation
         )

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/47a241c1/ForgeBlog/forgeblog/model/blog.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/model/blog.py b/ForgeBlog/forgeblog/model/blog.py
index 1168fe6..b6984d8 100644
--- a/ForgeBlog/forgeblog/model/blog.py
+++ b/ForgeBlog/forgeblog/model/blog.py
@@ -269,7 +269,7 @@ class BlogPost(M.VersionedArtifact, ActivityObject):
                     title=self.title,
                     url=h.absurl('/rest' + self.url()),
                     text=self.text,
-                    labels=self.labels,
+                    labels=list(self.labels),
                     state=self.state)
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/47a241c1/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 5bd7788..cd28e35 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -1001,7 +1001,7 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
             private=self.private,
             attachments=[dict(bytes=attach.length,
                               url=h.absurl(attach.url())) for attach in self.attachments],
-            custom_fields=self.custom_fields)
+            custom_fields=dict(self.custom_fields))
 
     @classmethod
     def paged_query(cls, app_config, user, query, limit=None, page=0, sort=None, deleted=False,
**kw):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/47a241c1/ForgeWiki/forgewiki/model/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
index 8d5894a..23adb8c 100644
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -109,7 +109,7 @@ class Page(VersionedArtifact, ActivityObject):
         return dict(super(Page, self).__json__(),
                     title=self.title,
                     text=self.text,
-                    labels=self.labels,
+                    labels=list(self.labels),
                     attachments=[dict(bytes=attach.length,
                                       url=h.absurl(attach.url())) for attach in self.attachments])
 


Mime
View raw message