Show More
@@ -470,7 +470,14 b' class RepoRoutePredicate(object):' | |||
|
470 | 470 | |
|
471 | 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(route_info, db_repo): | |
|
474 | skip_views = ['edit_repo_advanced_delete'] | |
|
475 | route = route_info['route'] | |
|
476 | # we should skip delete view so we can actually "remove" repositories | |
|
477 | # if they get stuck in creating state. | |
|
478 | if route.name in skip_views: | |
|
479 | return | |
|
480 | ||
|
474 | 481 | if db_repo.repo_state in [repo.Repository.STATE_PENDING]: |
|
475 | 482 | repo_creating_url = request.route_path( |
|
476 | 483 | 'repo_creating', repo_name=db_repo.repo_name) |
@@ -479,13 +486,13 b' class RepoRoutePredicate(object):' | |||
|
479 | 486 | if by_name_match: |
|
480 | 487 | # register this as request object we can re-use later |
|
481 | 488 | request.db_repo = by_name_match |
|
482 | redirect_if_creating(by_name_match) | |
|
489 | redirect_if_creating(info, by_name_match) | |
|
483 | 490 | return True |
|
484 | 491 | |
|
485 | 492 | by_id_match = repo_model.get_repo_by_id(repo_name) |
|
486 | 493 | if by_id_match: |
|
487 | 494 | request.db_repo = by_id_match |
|
488 | redirect_if_creating(by_id_match) | |
|
495 | redirect_if_creating(info, by_id_match) | |
|
489 | 496 | return True |
|
490 | 497 | |
|
491 | 498 | return False |
General Comments 0
You need to be logged in to leave comments.
Login now