# HG changeset patch # User Marcin Kuzminski # Date 2017-03-05 21:45:17 # Node ID 13903a1345e03343eb886babafad10ebacc96a76 # Parent 77606b4cd10c373a24a45561e9020020ccff407f pyramid-admin: use new base app view in exchange of dedicated admin view. - Previous admin view was the same as the new base, minus some common functions. diff --git a/rhodecode/apps/admin/views/base.py b/rhodecode/apps/admin/views/base.py deleted file mode 100644 --- a/rhodecode/apps/admin/views/base.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (C) 2016-2017 RhodeCode GmbH -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License, version 3 -# (only), as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# This program is dual-licensed. If you wish to learn more about the -# RhodeCode Enterprise Edition, including its added features, Support services, -# and proprietary license terms, please see https://rhodecode.com/licenses/ - - -class AdminSettingsView(object): - - def __init__(self, context, request): - self.request = request - self.context = context - self.session = request.session - self._rhodecode_user = request.user diff --git a/rhodecode/apps/admin/views/open_source_licenses.py b/rhodecode/apps/admin/views/open_source_licenses.py --- a/rhodecode/apps/admin/views/open_source_licenses.py +++ b/rhodecode/apps/admin/views/open_source_licenses.py @@ -24,7 +24,7 @@ import logging from pylons import tmpl_context as c from pyramid.view import view_config -from rhodecode.apps.admin.views.base import AdminSettingsView +from rhodecode.apps._base import BaseAppView from rhodecode.apps.admin.navigation import navigation_list from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator) from rhodecode.lib.utils import read_opensource_licenses @@ -32,7 +32,7 @@ from rhodecode.lib.utils import read_ope log = logging.getLogger(__name__) -class OpenSourceLicensesAdminSettingsView(AdminSettingsView): +class OpenSourceLicensesAdminSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') diff --git a/rhodecode/apps/admin/views/sessions.py b/rhodecode/apps/admin/views/sessions.py --- a/rhodecode/apps/admin/views/sessions.py +++ b/rhodecode/apps/admin/views/sessions.py @@ -24,9 +24,7 @@ from pylons import tmpl_context as c from pyramid.view import view_config from pyramid.httpexceptions import HTTPFound -from rhodecode.translation import _ - -from rhodecode.apps.admin.views.base import AdminSettingsView +from rhodecode.apps._base import BaseAppView from rhodecode.apps.admin.navigation import navigation_list from rhodecode.lib.auth import ( LoginRequired, HasPermissionAllDecorator, CSRFRequired) @@ -38,7 +36,7 @@ from rhodecode.lib import user_sessions log = logging.getLogger(__name__) -class AdminSessionSettingsView(AdminSettingsView): +class AdminSessionSettingsView(BaseAppView): @LoginRequired() @HasPermissionAllDecorator('hg.admin') diff --git a/rhodecode/apps/admin/views/svn_config.py b/rhodecode/apps/admin/views/svn_config.py --- a/rhodecode/apps/admin/views/svn_config.py +++ b/rhodecode/apps/admin/views/svn_config.py @@ -22,16 +22,15 @@ import logging from pyramid.view import view_config +from rhodecode.apps._base import BaseAppView from rhodecode.svn_support.utils import generate_mod_dav_svn_config - -from rhodecode.apps.admin.views.base import AdminSettingsView from rhodecode.lib.auth import ( LoginRequired, HasPermissionAllDecorator, CSRFRequired) log = logging.getLogger(__name__) -class SvnConfigAdminSettingsView(AdminSettingsView): +class SvnConfigAdminSettingsView(BaseAppView): @LoginRequired() @CSRFRequired() diff --git a/rhodecode/apps/admin/views/system_info.py b/rhodecode/apps/admin/views/system_info.py --- a/rhodecode/apps/admin/views/system_info.py +++ b/rhodecode/apps/admin/views/system_info.py @@ -26,7 +26,7 @@ from pylons import tmpl_context as c from pyramid.view import view_config import rhodecode -from rhodecode.apps.admin.views.base import AdminSettingsView +from rhodecode.apps._base import BaseAppView from rhodecode.apps.admin.navigation import navigation_list from rhodecode.lib import helpers as h from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator) @@ -38,7 +38,7 @@ from rhodecode.model.settings import Set log = logging.getLogger(__name__) -class AdminSystemInfoSettingsView(AdminSettingsView): +class AdminSystemInfoSettingsView(BaseAppView): @staticmethod def get_update_data(update_url):