You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2016/02/05 20:12:53 UTC

[6/6] allura git commit: [#7921] remove some now-unused controllers that still redirected to the tools page. clone was very very old

[#7921] remove some now-unused controllers that still redirected to the tools page.  clone was very very old


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

Branch: refs/heads/master
Commit: b0371e9664a2e2c199d04cc2bdab7e86982dce38
Parents: 95c1c3a
Author: Dave Brondsema <da...@brondsema.net>
Authored: Fri Feb 5 14:11:38 2016 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Feb 5 14:11:38 2016 -0500

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py        | 59 -----------------------
 Allura/allura/tests/functional/test_admin.py | 14 ------
 2 files changed, 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/b0371e96/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 ecdd76e..c406e97 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -263,21 +263,6 @@ class ProjectAdminController(BaseController):
     def tools_moved(self, **kw):
         return {}
 
-
-    @expose()
-    @require_post()
-    def configure_tool_grouping(self, grouping_threshold='1', page=0, limit=200, **kw):
-        try:
-            grouping_threshold = int(grouping_threshold)
-            if grouping_threshold < 1:
-                raise ValueError('Invalid threshold')
-            c.project.set_tool_data(
-                'allura', grouping_threshold=grouping_threshold)
-            g.post_event('project_menu_updated')
-        except ValueError:
-            flash('Invalid threshold', 'error')
-        redirect('tools?limit=%s&page=%s' % (limit, page))
-
     @expose()
     @require_post()
     def update_labels(self, labels=None, **kw):
@@ -287,35 +272,6 @@ class ProjectAdminController(BaseController):
         redirect('trove')
 
     @without_trailing_slash
-    @expose()
-    def clone(self,
-              repo_type=None, source_url=None,
-              mount_point=None, mount_label=None,
-              **kw):
-        require_access(c.project, 'admin')
-        if repo_type is None:
-            return (
-                '<form method="get">'
-                '<input name="repo_type" value="Git">'
-                '<input name="source_url">'
-                '<input type="submit">'
-                '</form>')
-        for ep in h.iter_entry_points('allura', repo_type):
-            break
-        if ep is None or source_url is None:
-            raise exc.HTTPNotFound
-        h.log_action(log, 'install tool').info(
-            'clone repo from %s', source_url,
-            meta=dict(tool_type=repo_type, mount_point=mount_point, mount_label=mount_label))
-        c.project.install_app(
-            repo_type,
-            mount_point=mount_point,
-            mount_label=mount_label,
-            init_from_url=source_url)
-        M.AuditLog.log('Create repo as clone')
-        redirect('tools')
-
-    @without_trailing_slash
     @expose('jinja:allura.ext.admin:templates/project_install_tool.html')
     def install_tool(self, tool_name=None, **kw):
         if tool_name == 'subproject':
@@ -620,21 +576,6 @@ class ProjectAdminController(BaseController):
         flash('Joined %s' % n.name)
         redirect('invitations')
 
-    @h.vardec
-    @expose()
-    @require_post()
-    def update_mount_order(self, subs=None, tools=None, **kw):
-        if subs:
-            for sp in subs:
-                p = M.Project.query.get(shortname=sp['shortname'],
-                                        neighborhood_id=c.project.neighborhood_id)
-                p.ordinal = int(sp['ordinal'])
-        if tools:
-            for p in tools:
-                c.project.app_config(p['mount_point']).options.ordinal = int(p['ordinal'])
-        g.post_event('project_menu_updated')
-        redirect('tools')
-
     def _update_mounts(self, subproject=None, tool=None, new=None, **kw):
         '''
 

http://git-wip-us.apache.org/repos/asf/allura/blob/b0371e96/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index b4167b1..97c6d8d 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -377,20 +377,6 @@ class TestProjectAdmin(TestController):
         r = self.app.get('/admin/install_tool?tool_name=subproject')
         assert_in(u'Installing Sub Project', r)
 
-    def test_grouping_threshold(self):
-        c.user = M.User.query.get(username='root')
-        c.project = M.Project.query.get(shortname='test')
-        data = c.project.nav_data(admin_options=True)
-        assert_equals(data['grouping_threshold'], 1)
-
-        self.app.post('/admin/configure_tool_grouping', params={
-            'grouping_threshold': '2',
-        })
-
-        c.project = M.Project.query.get(shortname='test')
-        data = c.project.nav_data(admin_options=True)
-        assert_equals(data['grouping_threshold'], 2)
-
     def test_project_icon(self):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(