allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [12/12] allura git commit: [#8023] ticket:879 change my_projects_by_role_name, fix tests
Date Tue, 15 Dec 2015 14:24:44 GMT
[#8023] ticket:879 change my_projects_by_role_name, fix tests


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

Branch: refs/heads/ib/8023b
Commit: 5dc99b3f5a7fda3ce6aa9e860524759755d74dbf
Parents: 697dccf
Author: Denis Kotov <deniskkotov@gmail.com>
Authored: Fri Dec 11 17:07:05 2015 +0200
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Dec 15 13:43:03 2015 +0200

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py        | 2 +-
 Allura/allura/model/auth.py        | 2 +-
 Allura/allura/tests/test_plugin.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5dc99b3f/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 9247577..cf833c1 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -1319,7 +1319,7 @@ class ThemeProvider(object):
         if note.user_role and c.user.is_anonymous():
             return None
         if note.user_role:
-            projects = c.user.my_projects_by_role_name(note.user_role).all()
+            projects = c.user.my_projects_by_role_name(note.user_role)
             if len(projects) == 0 or len(projects) == 1 and projects[0].is_user_project:
                 return None
 

http://git-wip-us.apache.org/repos/asf/allura/blob/5dc99b3f/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 955c952..34d0877 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -770,7 +770,7 @@ class User(MappedClass, ActivityNode, ActivityObject, SearchIndexable):
         projects = [r['project_id'] for r in reaching_roles]
         from .project import Project
 
-        return Project.query.find({'_id': {'$in': projects}, 'deleted': False})
+        return Project.query.find({'_id': {'$in': projects}, 'deleted': False}).all()
 
     def set_password(self, new_password):
         return plugin.AuthenticationProvider.get(request).set_password(

http://git-wip-us.apache.org/repos/asf/allura/blob/5dc99b3f/Allura/allura/tests/test_plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_plugin.py b/Allura/allura/tests/test_plugin.py
index 827ef73..d379d97 100644
--- a/Allura/allura/tests/test_plugin.py
+++ b/Allura/allura/tests/test_plugin.py
@@ -400,7 +400,7 @@ class TestThemeProvider(object):
         note.user_role = 'Test'
         note.page_regex = None
         note.page_tool_type = None
-        projects = User.my_projects_by_role_name.return_value.all
+        projects = User.my_projects_by_role_name
 
         User.is_anonymous.return_value = True
         assert_is(ThemeProvider().get_site_notification(), None)


Mime
View raw message