You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2014/03/04 19:40:44 UTC

[3/6] git commit: [#7204] Order user projects list by name

[#7204] Order user projects list by name

Signed-off-by: Cory Johns <cj...@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/a81b7921
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a81b7921
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a81b7921

Branch: refs/heads/cj/7204
Commit: a81b79216c29aff6a6a199d322d4ee97c6125eec
Parents: fe0aa16
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Feb 28 22:51:08 2014 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Mar 4 16:46:56 2014 +0000

----------------------------------------------------------------------
 Allura/allura/ext/user_profile/user_main.py | 5 ++++-
 Allura/allura/model/auth.py                 | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a81b7921/Allura/allura/ext/user_profile/user_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py
index 9a9e5f1..881a9ec 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -296,7 +296,10 @@ class ProjectsSection(ProfileSectionBase):
         context['projects'] = [
             project
             for project in self.user.my_projects()
-            if project != c.project and (self.user == c.user or h.has_access(project, 'read'))]
+            if project != c.project
+            and (self.user == c.user or h.has_access(project, 'read'))
+            and not project.is_nbhd_project
+            and not project.is_user_project]
         return context
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a81b7921/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index fbb06bc..4e93581 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -706,7 +706,7 @@ class User(MappedClass, ActivityNode, ActivityObject):
         # filter out projects to which the user belongs to no named groups (i.e., role['roles'] is empty)
         projects = [r['project_id'] for r in roles if r['roles']]
         from .project import Project
-        return Project.query.find({'_id': {'$in': projects}, 'deleted': False}).sort('last_updated', pymongo.DESCENDING)
+        return Project.query.find({'_id': {'$in': projects}, 'deleted': False}).sort('name', pymongo.ASCENDING)
 
     def my_projects_by_role_name(self, role_name):
         """