diff --git a/pagure/api/__init__.py b/pagure/api/__init__.py index 44ace7c..5d5c669 100644 --- a/pagure/api/__init__.py +++ b/pagure/api/__init__.py @@ -29,7 +29,7 @@ class APIERROR(enum.Enum): """ ENOCODE = 'Variable message describing the issue' ENOPROJECT = 'Project not found' - ENOTRACKER = 'No issue tracker found for this project' + ETRACKERDISABLED = 'Issue tracker disabled for this project' EDBERROR = 'An error occured at the database level and prevent the ' \ 'action from reaching completion' EINVALIDREQ = 'Invalid or incomplete input submited' diff --git a/pagure/api/issue.py b/pagure/api/issue.py index e55f6b1..b419de5 100644 --- a/pagure/api/issue.py +++ b/pagure/api/issue.py @@ -61,7 +61,8 @@ def api_new_issue(repo, username=None): raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOPROJECT) if not repo.settings.get('issue_tracker', True): - raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOTRACKER) + raise pagure.exceptions.APIError( + 404, error_code=APIERROR.ETRACKERDISABLED) if repo != flask.g.token.project: raise pagure.exceptions.APIError(401, error_code=APIERROR.EINVALIDTOK) @@ -252,7 +253,8 @@ def api_view_issues(repo, username=None): raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOPROJECT) if not repo.settings.get('issue_tracker', True): - raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOTRACKER) + raise pagure.exceptions.APIError( + 404, error_code=APIERROR.ETRACKERDISABLED) status = flask.request.args.get('status', None) tags = flask.request.args.getlist('tags') @@ -358,7 +360,8 @@ def api_view_issue(repo, issueid, username=None): raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOPROJECT) if not repo.settings.get('issue_tracker', True): - raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOTRACKER) + raise pagure.exceptions.APIError( + 404, error_code=APIERROR.ETRACKERDISABLED) issue = pagure.lib.search_issues(SESSION, repo, issueid=issueid) @@ -412,7 +415,8 @@ def api_change_status_issue(repo, issueid, username=None): raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOPROJECT) if not repo.settings.get('issue_tracker', True): - raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOTRACKER) + raise pagure.exceptions.APIError( + 404, error_code=APIERROR.ETRACKERDISABLED) if repo != flask.g.token.project: raise pagure.exceptions.APIError(401, error_code=APIERROR.EINVALIDTOK) @@ -496,7 +500,8 @@ def api_comment_issue(repo, issueid, username=None): raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOPROJECT) if not repo.settings.get('issue_tracker', True): - raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOTRACKER) + raise pagure.exceptions.APIError( + 404, error_code=APIERROR.ETRACKERDISABLED) if repo.fullname != flask.g.token.project.fullname: raise pagure.exceptions.APIError(401, error_code=APIERROR.EINVALIDTOK)