From 85a8f6268986d86d9311d3254eb3878fe764d1f3 Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Mar 08 2016 13:54:22 +0000 Subject: Add a status all in the api the fetch all the issues from pagure --- diff --git a/pagure/api/issue.py b/pagure/api/issue.py index c570b14..4430177 100644 --- a/pagure/api/issue.py +++ b/pagure/api/issue.py @@ -160,7 +160,9 @@ def api_view_issues(repo, username=None): | Key | Type | Optionality | Description | +===============+=========+==============+===========================+ | ``status`` | string | Optional | | Filters the status of | - | | | | issues. Default: | + | | | | issues. Fetches all the | + | | | | issues if status is | + | | | | ``all``. Default: | | | | | ``Open`` | +---------------+---------+--------------+---------------------------+ | ``tags`` | string | Optional | | A list of tags you | @@ -246,26 +248,19 @@ def api_view_issues(repo, username=None): private = None if status is not None: + params = { + 'session': SESSION, + 'repo': repo, + 'tags': tags, + 'assignee': assignee, + 'author': author, + 'private': private + } if status.lower() == 'closed': - issues = pagure.lib.search_issues( - SESSION, - repo, - closed=True, - tags=tags, - assignee=assignee, - author=author, - private=private, - ) - else: - issues = pagure.lib.search_issues( - SESSION, - repo, - status=status, - tags=tags, - assignee=assignee, - author=author, - private=private, - ) + params.update({'closed': True}) + elif status.lower() != 'all': + params.update({'status': status}) + issues = pagure.lib.search_issues(**params) else: issues = pagure.lib.search_issues( SESSION, repo, status='Open', tags=tags, assignee=assignee,