##// END OF EJS Templates
vcs: Use correct repo name attribute and remove workaround.
Martin Bornhold -
r898:b19bad01 default
parent child Browse files
Show More
@@ -153,11 +153,6 b' class SimpleVCS(object):'
153 self.pr_id = None
153 self.pr_id = None
154
154
155 @property
155 @property
156 def repo_name(self):
157 # TODO: johbo: Remove, switch to correct repo name attribute
158 return self.acl_repo_name
159
160 @property
161 def scm_app(self):
156 def scm_app(self):
162 custom_implementation = self.config.get('vcs.scm_app_implementation')
157 custom_implementation = self.config.get('vcs.scm_app_implementation')
163 if custom_implementation and custom_implementation != 'pyro4':
158 if custom_implementation and custom_implementation != 'pyro4':
@@ -289,11 +284,11 b' class SimpleVCS(object):'
289 log.debug('User not allowed to proceed, %s', reason)
284 log.debug('User not allowed to proceed, %s', reason)
290 return HTTPNotAcceptable(reason)(environ, start_response)
285 return HTTPNotAcceptable(reason)(environ, start_response)
291
286
292 if not self.repo_name:
287 if not self.url_repo_name:
293 log.warning('Repository name is empty: %s', self.repo_name)
288 log.warning('Repository name is empty: %s', self.url_repo_name)
294 # failed to get repo name, we fail now
289 # failed to get repo name, we fail now
295 return HTTPNotFound()(environ, start_response)
290 return HTTPNotFound()(environ, start_response)
296 log.debug('Extracted repo name is %s', self.repo_name)
291 log.debug('Extracted repo name is %s', self.url_repo_name)
297
292
298 ip_addr = get_ip_addr(environ)
293 ip_addr = get_ip_addr(environ)
299 username = None
294 username = None
@@ -324,7 +319,7 b' class SimpleVCS(object):'
324 if anonymous_user.active:
319 if anonymous_user.active:
325 # ONLY check permissions if the user is activated
320 # ONLY check permissions if the user is activated
326 anonymous_perm = self._check_permission(
321 anonymous_perm = self._check_permission(
327 action, anonymous_user, self.repo_name, ip_addr)
322 action, anonymous_user, self.acl_repo_name, ip_addr)
328 else:
323 else:
329 anonymous_perm = False
324 anonymous_perm = False
330
325
@@ -389,7 +384,7 b' class SimpleVCS(object):'
389
384
390 # check permissions for this repository
385 # check permissions for this repository
391 perm = self._check_permission(
386 perm = self._check_permission(
392 action, user, self.repo_name, ip_addr)
387 action, user, self.acl_repo_name, ip_addr)
393 if not perm:
388 if not perm:
394 return HTTPForbidden()(environ, start_response)
389 return HTTPForbidden()(environ, start_response)
395
390
@@ -397,14 +392,14 b' class SimpleVCS(object):'
397 # in hooks executed by rhodecode
392 # in hooks executed by rhodecode
398 check_locking = _should_check_locking(environ.get('QUERY_STRING'))
393 check_locking = _should_check_locking(environ.get('QUERY_STRING'))
399 extras = vcs_operation_context(
394 extras = vcs_operation_context(
400 environ, repo_name=self.repo_name, username=username,
395 environ, repo_name=self.acl_repo_name, username=username,
401 action=action, scm=self.SCM,
396 action=action, scm=self.SCM,
402 check_locking=check_locking)
397 check_locking=check_locking)
403
398
404 # ======================================================================
399 # ======================================================================
405 # REQUEST HANDLING
400 # REQUEST HANDLING
406 # ======================================================================
401 # ======================================================================
407 str_repo_name = safe_str(self.repo_name)
402 str_repo_name = safe_str(self.url_repo_name)
408 repo_path = os.path.join(
403 repo_path = os.path.join(
409 safe_str(self.basepath), safe_str(self.vcs_repo_name))
404 safe_str(self.basepath), safe_str(self.vcs_repo_name))
410 log.debug('Repository path is %s', repo_path)
405 log.debug('Repository path is %s', repo_path)
General Comments 0
You need to be logged in to leave comments. Login now