allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#5269] consistent ordering of forums
Date Fri, 09 Nov 2012 21:49:48 GMT
Updated Branches:
  refs/heads/db/5269 [created] 9c4ed3dbd


[#5269] consistent ordering of forums


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

Branch: refs/heads/db/5269
Commit: 9c4ed3dbd44cd7fc19a48b47d49c7c4d5ba13eb4
Parents: ee3b451
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Fri Nov 9 21:49:41 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Fri Nov 9 21:49:41 2012 +0000

----------------------------------------------------------------------
 .../forgediscussion/controllers/root.py            |    2 +-
 ForgeDiscussion/forgediscussion/forum_main.py      |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9c4ed3db/ForgeDiscussion/forgediscussion/controllers/root.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index 0bc6c72..00beb04 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -58,7 +58,7 @@ class RootController(BaseController, DispatchIndex):
                 )).all()
         forums = model.Forum.query.find(dict(
                         app_config_id=c.app.config._id,
-                        parent_id=None, deleted=False)).all()
+                        parent_id=None, deleted=False)).sort('_id').all()
         forums = [f for f in forums if h.has_access(f, 'read')()]
         return dict(forums=forums,
                     announcements=announcements,

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9c4ed3db/ForgeDiscussion/forgediscussion/forum_main.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/forum_main.py b/ForgeDiscussion/forgediscussion/forum_main.py
index 6cafe1e..018f6fc 100644
--- a/ForgeDiscussion/forgediscussion/forum_main.py
+++ b/ForgeDiscussion/forgediscussion/forum_main.py
@@ -100,7 +100,7 @@ class ForgeDiscussionApp(Application):
 
     @property
     def forums(self):
-        return DM.Forum.query.find(dict(app_config_id=self.config._id)).all()
+        return DM.Forum.query.find(dict(app_config_id=self.config._id)).sort('_id').all()
 
     @property
     def top_forums(self):
@@ -127,7 +127,7 @@ class ForgeDiscussionApp(Application):
             forum_links = []
             forums = DM.Forum.query.find(dict(
                             app_config_id=c.app.config._id,
-                            parent_id=None, deleted=False))
+                            parent_id=None, deleted=False)).sort('_id')
             for f in forums:
                 if has_access(f,'read')():
                     if f.url() in request.url and h.has_access(f, 'moderate')():
@@ -265,4 +265,3 @@ class ForumAdminController(DefaultAdminController):
     def add_forum(self, add_forum=None, **kw):
         f = utils.create_forum(self.app, add_forum)
         redirect(f.url())
-


Mime
View raw message