##// END OF EJS Templates
core: fixed cython compat inspect that caused some API calls to not work correctly.
marcink -
r4184:ac8c6020 stable
parent child Browse files
Show More
@@ -18,7 +18,6 b''
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import inspect
22 import itertools
21 import itertools
23 import logging
22 import logging
24 import sys
23 import sys
@@ -186,10 +185,12 b' def request_view(request):'
186 Main request handling method. It handles all logic to call a specific
185 Main request handling method. It handles all logic to call a specific
187 exposed method
186 exposed method
188 """
187 """
188 # cython compatible inspect
189 from rhodecode.config.patches import inspect_getargspec
190 inspect = inspect_getargspec()
189
191
190 # check if we can find this session using api_key, get_by_auth_token
192 # check if we can find this session using api_key, get_by_auth_token
191 # search not expired tokens only
193 # search not expired tokens only
192
193 try:
194 try:
194 api_user = User.get_by_auth_token(request.rpc_api_key)
195 api_user = User.get_by_auth_token(request.rpc_api_key)
195
196
@@ -18,7 +18,6 b''
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import inspect
22 import logging
21 import logging
23 import itertools
22 import itertools
24 import base64
23 import base64
@@ -334,6 +333,9 b' def get_method(request, apiuser, pattern'
334 ]
333 ]
335 error : null
334 error : null
336 """
335 """
336 from rhodecode.config.patches import inspect_getargspec
337 inspect = inspect_getargspec()
338
337 if not has_superadmin_permission(apiuser):
339 if not has_superadmin_permission(apiuser):
338 raise JSONRPCForbidden()
340 raise JSONRPCForbidden()
339
341
@@ -95,3 +95,5 b' def inspect_getargspec():'
95 return inspect.ArgSpec(args, varargs, varkw, func.func_defaults)
95 return inspect.ArgSpec(args, varargs, varkw, func.func_defaults)
96
96
97 inspect.getargspec = custom_getargspec
97 inspect.getargspec = custom_getargspec
98
99 return inspect
@@ -24,7 +24,6 b' authentication and permission libraries'
24
24
25 import os
25 import os
26 import time
26 import time
27 import inspect
28 import collections
27 import collections
29 import fnmatch
28 import fnmatch
30 import hashlib
29 import hashlib
@@ -2013,6 +2012,7 b' class PermsFunction(object):'
2013 self.user_group_name = None
2012 self.user_group_name = None
2014
2013
2015 def __bool__(self):
2014 def __bool__(self):
2015 import inspect
2016 frame = inspect.currentframe()
2016 frame = inspect.currentframe()
2017 stack_trace = traceback.format_stack(frame)
2017 stack_trace = traceback.format_stack(frame)
2018 log.error('Checking bool value on a class instance of perm '
2018 log.error('Checking bool value on a class instance of perm '
General Comments 0
You need to be logged in to leave comments. Login now