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
|
@ -450,12 +450,12 @@ class ActivateBuildTrigger(RepositoryParamResource):
|
|||
class TriggerBuildList(RepositoryParamResource):
|
||||
""" Resource to represent builds that were activated from the specified trigger. """
|
||||
@require_repo_admin
|
||||
@parse_args
|
||||
@parse_args()
|
||||
@query_param('limit', 'The maximum number of builds to return', type=int, default=5)
|
||||
@nickname('listTriggerRecentBuilds')
|
||||
def get(self, args, namespace, repository, trigger_uuid):
|
||||
def get(self, namespace, repository, trigger_uuid, parsed_args):
|
||||
""" List the builds started by the specified trigger. """
|
||||
limit = args['limit']
|
||||
limit = parsed_args['limit']
|
||||
builds = model.build.list_trigger_builds(namespace, repository, trigger_uuid, limit)
|
||||
return {
|
||||
'builds': [build_status_view(bld) for bld in builds]
|
||||
|
|
Reference in a new issue