allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [38/50] git commit: [#6077] even though Profile tool and ForgeUserStats may get installed automatically as part of the /u/ anchored tools, don't use them on user subproject menus
Date Tue, 16 Apr 2013 12:29:28 GMT
[#6077] even though Profile tool and ForgeUserStats may get installed automatically as part
of the /u/ anchored tools, don't use them on user subproject menus


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

Branch: refs/heads/acs2/5518
Commit: 15b4e7a25d6a7e1984444919deccb2caf3fec61b
Parents: 9647941
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Fri Apr 12 20:57:27 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Apr 12 21:21:58 2013 +0000

----------------------------------------------------------------------
 Allura/allura/ext/user_profile/user_main.py |    3 ++-
 Allura/allura/tests/functional/test_home.py |    4 ++--
 ForgeUserStats/forgeuserstats/main.py       |    4 ++++
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/15b4e7a2/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 907271a..dd59304 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -48,7 +48,8 @@ class UserProfileApp(Application):
         return [SitemapEntry('Profile', '.')]
 
     def is_visible_to(self, user):
-        return True
+        # we don't work with user subprojects
+        return c.project.is_root
 
     def install(self, project):
         pr = c.user.project_role()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/15b4e7a2/Allura/allura/tests/functional/test_home.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_home.py b/Allura/allura/tests/functional/test_home.py
index 1bb626a..758132e 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -5,7 +5,7 @@ from allura.tests import TestController
 from allura.tests import decorators as td
 from allura import model as M
 
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_not_in
 
 
 class TestProjectHome(TestController):
@@ -35,7 +35,7 @@ class TestProjectHome(TestController):
 
         r = self.app.get('/u/test-admin/sub1/')
         assert r.location.endswith('admin/'), r.location
-        r.follow()
+        assert_not_in('Profile', r.follow().body)
 
     def test_user_search(self):
         r = self.app.get('/p/test/user_search?term=test', status=200)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/15b4e7a2/ForgeUserStats/forgeuserstats/main.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/main.py b/ForgeUserStats/forgeuserstats/main.py
index 95bfbfa..6cc4162 100644
--- a/ForgeUserStats/forgeuserstats/main.py
+++ b/ForgeUserStats/forgeuserstats/main.py
@@ -98,6 +98,10 @@ class ForgeUserStatsApp(Application):
     def main_menu(self):
         return [SitemapEntry(self.config.options.mount_label, '.')]
 
+    def is_visible_to(self, user):
+        # we don't work with user subprojects
+        return c.project.is_root
+
     @property
     @h.exceptionless([], log)
     def sitemap(self):


Mime
View raw message