##// END OF EJS Templates
admin: moved admin pyramid into apps.
marcink -
r1503:91b1464c default
parent child Browse files
Show More
@@ -19,7 +19,7 b''
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 21
22 from rhodecode.admin.navigation import NavigationRegistry
22 from rhodecode.apps.admin.navigation import NavigationRegistry
23 23 from rhodecode.config.routing import ADMIN_PREFIX
24 24 from rhodecode.lib.utils2 import str2bool
25 25
1 NO CONTENT: file renamed from rhodecode/admin/interfaces.py to rhodecode/apps/admin/interfaces.py
@@ -25,7 +25,7 b' import collections'
25 25 from pylons import url
26 26 from zope.interface import implementer
27 27
28 from rhodecode.admin.interfaces import IAdminNavigationRegistry
28 from rhodecode.apps.admin.interfaces import IAdminNavigationRegistry
29 29 from rhodecode.lib.utils import get_registry
30 30 from rhodecode.translation import _
31 31
1 NO CONTENT: file renamed from rhodecode/admin/views/__init__.py to rhodecode/apps/admin/views/__init__.py
1 NO CONTENT: file renamed from rhodecode/admin/views/base.py to rhodecode/apps/admin/views/base.py
@@ -24,8 +24,8 b' import logging'
24 24 from pylons import tmpl_context as c
25 25 from pyramid.view import view_config
26 26
27 from rhodecode.admin.views.base import AdminSettingsView
28 from rhodecode.admin.navigation import navigation_list
27 from rhodecode.apps.admin.views.base import AdminSettingsView
28 from rhodecode.apps.admin.navigation import navigation_list
29 29 from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator)
30 30 from rhodecode.lib.utils import read_opensource_licenses
31 31
@@ -26,7 +26,8 b' from pyramid.httpexceptions import HTTPF'
26 26
27 27 from rhodecode.translation import _
28 28
29 from rhodecode.admin.views.base import AdminSettingsView
29 from rhodecode.apps.admin.views.base import AdminSettingsView
30 from rhodecode.apps.admin.navigation import navigation_list
30 31 from rhodecode.lib.auth import (
31 32 LoginRequired, HasPermissionAllDecorator, CSRFRequired)
32 33 from rhodecode.lib.utils2 import safe_int
@@ -34,9 +35,6 b' from rhodecode.lib import system_info'
34 35 from rhodecode.lib import user_sessions
35 36
36 37
37 from rhodecode.admin.navigation import navigation_list
38
39
40 38 log = logging.getLogger(__name__)
41 39
42 40
@@ -24,7 +24,7 b' from pyramid.view import view_config'
24 24
25 25 from rhodecode.svn_support.utils import generate_mod_dav_svn_config
26 26
27 from rhodecode.admin.views.base import AdminSettingsView
27 from rhodecode.apps.admin.views.base import AdminSettingsView
28 28 from rhodecode.lib.auth import (
29 29 LoginRequired, HasPermissionAllDecorator, CSRFRequired)
30 30
@@ -26,14 +26,13 b' from pylons import tmpl_context as c'
26 26 from pyramid.view import view_config
27 27
28 28 import rhodecode
29 from rhodecode.apps.admin.views.base import AdminSettingsView
30 from rhodecode.apps.admin.navigation import navigation_list
29 31 from rhodecode.lib import helpers as h
30 32 from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator)
31 33 from rhodecode.lib.utils2 import str2bool
32 34 from rhodecode.lib import system_info
33 35 from rhodecode.lib.ext_json import json
34
35 from rhodecode.admin.views.base import AdminSettingsView
36 from rhodecode.admin.navigation import navigation_list
37 36 from rhodecode.model.settings import SettingsModel
38 37
39 38 log = logging.getLogger(__name__)
@@ -277,18 +277,20 b' def includeme(config):'
277 277 # Includes which are required. The application would fail without them.
278 278 config.include('pyramid_mako')
279 279 config.include('pyramid_beaker')
280
280 281 config.include('rhodecode.channelstream')
281 config.include('rhodecode.admin')
282 282 config.include('rhodecode.authentication')
283 283 config.include('rhodecode.integrations')
284 284
285 285 # apps
286 config.include('rhodecode.apps.admin')
286 287 config.include('rhodecode.apps.login')
287 288 config.include('rhodecode.apps.user_profile')
288 289
289 290 config.include('rhodecode.tweens')
290 291 config.include('rhodecode.api')
291 292 config.include('rhodecode.svn_support')
293
292 294 config.add_route(
293 295 'rhodecode_support', 'https://rhodecode.com/help/', static=True)
294 296
@@ -36,7 +36,7 b' from pyramid.threadlocal import get_curr'
36 36 from webob.exc import HTTPBadRequest
37 37
38 38 import rhodecode
39 from rhodecode.admin.navigation import navigation_list
39 from rhodecode.apps.admin.navigation import navigation_list
40 40 from rhodecode.lib import auth
41 41 from rhodecode.lib import helpers as h
42 42 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
@@ -29,6 +29,7 b' from pyramid.httpexceptions import HTTPF'
29 29 from pyramid.renderers import render
30 30 from pyramid.response import Response
31 31
32 from rhodecode.apps.admin.navigation import navigation_list
32 33 from rhodecode.lib import auth
33 34 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
34 35 from rhodecode.lib.utils2 import safe_int
@@ -36,7 +37,6 b' from rhodecode.lib.helpers import Page'
36 37 from rhodecode.model.db import Repository, RepoGroup, Session, Integration
37 38 from rhodecode.model.scm import ScmModel
38 39 from rhodecode.model.integration import IntegrationModel
39 from rhodecode.admin.navigation import navigation_list
40 40 from rhodecode.translation import _
41 41 from rhodecode.integrations import integration_type_registry
42 42 from rhodecode.model.validation_schema.schemas.integration_schema import (
@@ -79,7 +79,6 b' class IntegrationSettingsViewBase(object'
79 79 repo_group_name = request.matchdict['repo_group_name']
80 80 self.repo_group = RepoGroup.get_by_group_name(repo_group_name)
81 81
82
83 82 if 'integration' in request.matchdict: # integration type context
84 83 integration_type = request.matchdict['integration']
85 84 self.IntegrationType = integration_type_registry[integration_type]
@@ -380,12 +379,12 b' class GlobalIntegrationsView(Integration'
380 379
381 380 class RepoIntegrationsView(IntegrationSettingsViewBase):
382 381 def perm_check(self, user):
383 return auth.HasRepoPermissionAll('repository.admin'
384 )(repo_name=self.repo.repo_name, user=user)
382 return auth.HasRepoPermissionAll('repository.admin')(
383 repo_name=self.repo.repo_name, user=user)
385 384
386 385
387 386 class RepoGroupIntegrationsView(IntegrationSettingsViewBase):
388 387 def perm_check(self, user):
389 return auth.HasRepoGroupPermissionAll('group.admin'
390 )(group_name=self.repo_group.group_name, user=user)
388 return auth.HasRepoGroupPermissionAll('group.admin')(
389 group_name=self.repo_group.group_name, user=user)
391 390
@@ -32,7 +32,7 b' from rhodecode.tests.utils import Assert'
32 32
33 33
34 34 UPDATE_DATA_QUALNAME = (
35 'rhodecode.admin.views.system_info.AdminSystemInfoSettingsView.get_update_data')
35 'rhodecode.apps.admin.views.system_info.AdminSystemInfoSettingsView.get_update_data')
36 36
37 37
38 38 @pytest.mark.usefixtures('autologin_user', 'app')
@@ -425,7 +425,7 b' class TestOpenSourceLicenses(object):'
425 425 }
426 426 }
427 427 read_licenses_patch = mock.patch(
428 'rhodecode.admin.views.open_source_licenses.read_opensource_licenses',
428 'rhodecode.apps.admin.views.open_source_licenses.read_opensource_licenses',
429 429 return_value=sample_licenses)
430 430 with read_licenses_patch:
431 431 response = self.app.get(self._get_url(), status=200)
General Comments 0
You need to be logged in to leave comments. Login now