diff --git a/rhodecode/lib/pyramid_utils.py b/rhodecode/lib/pyramid_utils.py --- a/rhodecode/lib/pyramid_utils.py +++ b/rhodecode/lib/pyramid_utils.py @@ -21,7 +21,6 @@ import os from pyramid.compat import configparser from pyramid.paster import bootstrap as pyramid_bootstrap, setup_logging # pragma: no cover -from pyramid.scripting import prepare from rhodecode.lib.request import Request @@ -38,6 +37,8 @@ def get_app_config(ini_path): def bootstrap(config_uri, options=None, env=None): + from rhodecode.lib.utils2 import AttributeDict + if env: os.environ.update(env) @@ -49,6 +50,9 @@ def bootstrap(config_uri, options=None, pass request = Request.blank('/', base_url=base_url) - + # fake inject a running user for bootstrap request ! + request.user = AttributeDict({'username': 'bootstrap-user', + 'user_id': 1, + 'ip_addr': '127.0.0.1'}) return pyramid_bootstrap(config_uri, request=request, options=options)