1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-11 07:06:16 +01:00

Merge pull request #1254 from dmach/fix-rq-list-without-type-option

rq list: Fix a traceback when --type is not specified
This commit is contained in:
Daniel Mach 2023-02-09 13:57:21 +01:00 committed by GitHub
commit f25b503315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,6 @@
Feature: `osc request list` command
Scenario: Run `osc request list` on a project
When I execute osc with args "request list -P test:factory"
Then the exit code is 0

View File

@ -2771,9 +2771,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
req_type=opts.type, exclude_projects=opts.exclude_target_project or []) req_type=opts.type, exclude_projects=opts.exclude_target_project or [])
else: else:
roles = ["creator"] if opts.mine else None roles = ["creator"] if opts.mine else None
types = [opts.type] if opts.type else None
results = get_request_collection( results = get_request_collection(
apiurl, project=project, package=package, user=who, apiurl, project=project, package=package, user=who,
states=state_list, types=[opts.type], roles=roles) states=state_list, types=types, roles=roles)
# Check if project actually exists if result list is empty # Check if project actually exists if result list is empty
if not results: if not results: