allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: [#7919] only show subproject as an installable tool if project is top-level (not subproject itself)
Date Mon, 11 Jan 2016 18:15:14 GMT
Repository: allura
Updated Branches:
  refs/heads/master 57480b6c7 -> 71c5e82b2


[#7919] only show subproject as an installable tool if project is top-level (not subproject
itself)


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

Branch: refs/heads/master
Commit: bb4c5c0d83b250bd9e594e8c79a2695a10181b3d
Parents: 57480b6
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Jan 11 12:41:33 2016 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Jan 11 12:41:33 2016 -0500

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/bb4c5c0d/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index d1c04d3..45d5cc8 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -848,15 +848,17 @@ class ProjectAdminRestController(BaseController):
                 }
             })
 
-        tools.append({
-            'name': 'subproject',
-            'description': "With a Sub Project you can add an entire project just like any
other tool.",
-            'tool_label': 'Sub Project',
-            'defaults': {
-                'default_mount_label': 'Sub',
-                'default_mount_point': 'sub',
-            }
-        })
+        if c.project.is_root:
+            # subprojects only allowed on top-level projects (no nesting)
+            tools.append({
+                'name': 'subproject',
+                'description': "With a Sub Project you can add an entire project just like
any other tool.",
+                'tool_label': 'Sub Project',
+                'defaults': {
+                    'default_mount_label': 'Sub',
+                    'default_mount_point': 'sub',
+                }
+            })
         return {'tools': tools}
 
     @expose('json:')


Mime
View raw message