Refactor how parsed_args are passed to methods
This commit is contained in:
parent
daab1b3964
commit
018bf8c5ad
13 changed files with 142 additions and 137 deletions
|
@ -185,14 +185,14 @@ class RepositoryBuildList(RepositoryParamResource):
|
|||
}
|
||||
|
||||
@require_repo_read
|
||||
@parse_args
|
||||
@parse_args()
|
||||
@query_param('limit', 'The maximum number of builds to return', type=int, default=5)
|
||||
@query_param('since', 'Returns all builds since the given unix timecode', type=int, default=None)
|
||||
@nickname('getRepoBuilds')
|
||||
def get(self, args, namespace, repository):
|
||||
def get(self, namespace, repository, parsed_args):
|
||||
""" Get the list of repository builds. """
|
||||
limit = args.get('limit', 5)
|
||||
since = args.get('since', None)
|
||||
limit = parsed_args.get('limit', 5)
|
||||
since = parsed_args.get('since', None)
|
||||
|
||||
if since is not None:
|
||||
since = datetime.datetime.utcfromtimestamp(since)
|
||||
|
|
Reference in a new issue