Show More
@@ -461,20 +461,20 b' class RepoRoutePredicate(object):' | |||||
461 | phash = text |
|
461 | phash = text | |
462 |
|
462 | |||
463 | def __call__(self, info, request): |
|
463 | def __call__(self, info, request): | |
464 |
|
||||
465 | if hasattr(request, 'vcs_call'): |
|
464 | if hasattr(request, 'vcs_call'): | |
466 | # skip vcs calls |
|
465 | # skip vcs calls | |
467 | return |
|
466 | return | |
468 |
|
467 | |||
469 | repo_name = info['match']['repo_name'] |
|
468 | repo_name = info['match']['repo_name'] | |
470 | repo_model = repo.RepoModel() |
|
469 | repo_model = repo.RepoModel() | |
471 | by_name_match = repo_model.get_by_repo_name(repo_name, cache=True) |
|
470 | ||
|
471 | by_name_match = repo_model.get_by_repo_name(repo_name, cache=False) | |||
472 |
|
472 | |||
473 | def redirect_if_creating(db_repo): |
|
473 | def redirect_if_creating(db_repo): | |
474 | if db_repo.repo_state in [repo.Repository.STATE_PENDING]: |
|
474 | if db_repo.repo_state in [repo.Repository.STATE_PENDING]: | |
475 | raise HTTPFound( |
|
475 | repo_creating_url = request.route_path( | |
476 |
|
|
476 | 'repo_creating', repo_name=db_repo.repo_name) | |
477 | repo_name=db_repo.repo_name)) |
|
477 | raise HTTPFound(repo_creating_url) | |
478 |
|
478 | |||
479 | if by_name_match: |
|
479 | if by_name_match: | |
480 | # register this as request object we can re-use later |
|
480 | # register this as request object we can re-use later | |
@@ -516,7 +516,7 b' class RepoTypeRoutePredicate(object):' | |||||
516 | else: |
|
516 | else: | |
517 | log.warning('Current view is not supported for repo type:%s', |
|
517 | log.warning('Current view is not supported for repo type:%s', | |
518 | rhodecode_db_repo.repo_type) |
|
518 | rhodecode_db_repo.repo_type) | |
519 | # |
|
519 | ||
520 | # h.flash(h.literal( |
|
520 | # h.flash(h.literal( | |
521 | # _('Action not supported for %s.' % rhodecode_repo.alias)), |
|
521 | # _('Action not supported for %s.' % rhodecode_repo.alias)), | |
522 | # category='warning') |
|
522 | # category='warning') | |
@@ -542,8 +542,7 b' class RepoGroupRoutePredicate(object):' | |||||
542 |
|
542 | |||
543 | repo_group_name = info['match']['repo_group_name'] |
|
543 | repo_group_name = info['match']['repo_group_name'] | |
544 | repo_group_model = repo_group.RepoGroupModel() |
|
544 | repo_group_model = repo_group.RepoGroupModel() | |
545 | by_name_match = repo_group_model.get_by_group_name( |
|
545 | by_name_match = repo_group_model.get_by_group_name(repo_group_name, cache=False) | |
546 | repo_group_name, cache=True) |
|
|||
547 |
|
546 | |||
548 | if by_name_match: |
|
547 | if by_name_match: | |
549 | # register this as request object we can re-use later |
|
548 | # register this as request object we can re-use later | |
@@ -569,8 +568,7 b' class UserGroupRoutePredicate(object):' | |||||
569 |
|
568 | |||
570 | user_group_id = info['match']['user_group_id'] |
|
569 | user_group_id = info['match']['user_group_id'] | |
571 | user_group_model = user_group.UserGroup() |
|
570 | user_group_model = user_group.UserGroup() | |
572 | by_id_match = user_group_model.get( |
|
571 | by_id_match = user_group_model.get(user_group_id, cache=False) | |
573 | user_group_id, cache=True) |
|
|||
574 |
|
572 | |||
575 | if by_id_match: |
|
573 | if by_id_match: | |
576 | # register this as request object we can re-use later |
|
574 | # register this as request object we can re-use later | |
@@ -596,8 +594,7 b' class UserRoutePredicateBase(object):' | |||||
596 |
|
594 | |||
597 | user_id = info['match']['user_id'] |
|
595 | user_id = info['match']['user_id'] | |
598 | user_model = user.User() |
|
596 | user_model = user.User() | |
599 | by_id_match = user_model.get( |
|
597 | by_id_match = user_model.get(user_id, cache=False) | |
600 | user_id, cache=True) |
|
|||
601 |
|
598 | |||
602 | if by_id_match: |
|
599 | if by_id_match: | |
603 | # register this as request object we can re-use later |
|
600 | # register this as request object we can re-use later |
General Comments 0
You need to be logged in to leave comments.
Login now