diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index 7b678f8..d6e4a9e 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -31,14 +31,10 @@ def _get_parent_repo_path(repo): """ Return the path of the parent git repository corresponding to the provided Repository object from the DB. """ - - if repo.is_fork: + if repo.parent or repo.is_fork: parentpath = os.path.join(APP.config['GIT_FOLDER'], repo.parent.path) if repo.parent.is_fork: parentpath = os.path.join(APP.config['FORK_FOLDER'], repo.parent.path) - - if repo.parent: - parentpath = os.path.join(APP.config['GIT_FOLDER'], repo.parent.path) else: parentpath = os.path.join(APP.config['GIT_FOLDER'], repo.path)