# HG changeset patch # User Marcin Kuzminski # Date 2016-06-23 14:17:18 # Node ID 09af6d74033d6d143f6151ba59d1a8ce2b2a7422 # Parent c66c7ec2dbede8132de5e57154862350de01ae02 utils: make sure we don't import any models inside utils diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -52,8 +52,7 @@ from rhodecode.model import meta from rhodecode.model.db import ( Repository, User, RhodeCodeUi, UserLog, RepoGroup, UserGroup) from rhodecode.model.meta import Session -from rhodecode.model.repo_group import RepoGroupModel -from rhodecode.model.settings import VcsSettingsModel, SettingsModel + log = logging.getLogger(__name__) @@ -384,6 +383,8 @@ def config_data_from_db(clear_session=Tr Read the configuration data from the database and return configuration tuples. """ + from rhodecode.model.settings import VcsSettingsModel + config = [] sa = meta.Session() @@ -467,6 +468,7 @@ def set_rhodecode_config(config): :param config: """ + from rhodecode.model.settings import SettingsModel app_settings = SettingsModel().get_all_settings() for k, v in app_settings.items(): @@ -481,6 +483,7 @@ def map_groups(path): :param paths: full path to repository """ + from rhodecode.model.repo_group import RepoGroupModel sa = meta.Session() groups = path.split(Repository.NAME_SEP) parent = None @@ -525,6 +528,9 @@ def repo2db_mapper(initial_repo_list, re """ from rhodecode.model.repo import RepoModel from rhodecode.model.scm import ScmModel + from rhodecode.model.repo_group import RepoGroupModel + from rhodecode.model.settings import SettingsModel + sa = meta.Session() repo_model = RepoModel() user = User.get_first_admin()