diff --git a/pagure/api/project.py b/pagure/api/project.py index e2477c7..e60ba1f 100644 --- a/pagure/api/project.py +++ b/pagure/api/project.py @@ -54,12 +54,12 @@ def api_git_tags(repo, username=None, namespace=None): repo = pagure.lib.get_project( SESSION, repo, user=username, namespace=namespace) - if repo.private and not is_repo_admin(repo): - raise pagure.exceptions.APIError(403, error_code=APIERROR.EPROJECTNOTALLOWED) - if repo is None: raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOPROJECT) + if repo.private and not is_repo_admin(repo): + raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOPROJECT) + tags = pagure.lib.git.get_git_tags(repo) jsonout = flask.jsonify({ diff --git a/tests/test_pagure_private_repo.py b/tests/test_pagure_private_repo.py index d6d6694..61d0d9f 100644 --- a/tests/test_pagure_private_repo.py +++ b/tests/test_pagure_private_repo.py @@ -327,6 +327,21 @@ class PagurePrivateRepotest(tests.Modeltests): self.assertEqual( output.data.count('
No group found
'), 1) + self.assertEqual( + output.data.count('