mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 01:06:15 +01:00
- fixed do_my (was broken by commit 54513a23de
but nobody noticed it so far)
This commit is contained in:
parent
64ac6aeb4f
commit
b08802e9fe
@ -4838,20 +4838,21 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if opts.all:
|
||||
role_filter = ''
|
||||
|
||||
res = get_user_projpkgs(apiurl, user, role_filter,
|
||||
exclude_projects, what.has_key('project'), what.has_key('package'), opts.maintained)
|
||||
res = get_user_projpkgs(apiurl, user, role_filter, exclude_projects,
|
||||
what.has_key('project'), what.has_key('package'),
|
||||
opts.maintained, opts.verbose)
|
||||
request_todo = {}
|
||||
roles = {}
|
||||
if len(what.keys()) == 2:
|
||||
for i in res['project_id'].findall('project'):
|
||||
for i in res.get('project_id', res.get('project', {})).findall('project'):
|
||||
request_todo[i.get('name')] = []
|
||||
roles[i.get('name')] = [p.get('role') for p in i.findall('person') if p.get('userid') == user]
|
||||
for i in res['package_id'].findall('package'):
|
||||
for i in res.get('package_id', res.get('package', {})).findall('package'):
|
||||
roles['/'.join([i.get('project'), i.get('name')])] = [p.get('role') for p in i.findall('person') if p.get('userid') == user]
|
||||
if not i.get('project') in request_todo.keys():
|
||||
request_todo.setdefault(i.get('project'), []).append(i.get('name'))
|
||||
else:
|
||||
for i in res['project_id'].findall('project'):
|
||||
for i in res.get('project_id', res.get('project', {})).findall('project'):
|
||||
roles[i.get('name')] = [p.get('role') for p in i.findall('person') if p.get('userid') == user]
|
||||
|
||||
if list_requests:
|
||||
|
@ -5560,7 +5560,7 @@ def request_interactive_review(apiurl, request):
|
||||
if tmpfile is not None:
|
||||
tmpfile.close()
|
||||
|
||||
def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, pkg=True, maintained=False):
|
||||
def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, pkg=True, maintained=False, metadata=False):
|
||||
"""Return all project/packages where user is involved."""
|
||||
xpath = 'person/@userid = \'%s\'' % user
|
||||
excl_prj = ''
|
||||
@ -5579,8 +5579,14 @@ def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, p
|
||||
|
||||
what = {}
|
||||
if pkg:
|
||||
if metadata:
|
||||
what['package'] = xpath_pkg
|
||||
else:
|
||||
what['package_id'] = xpath_pkg
|
||||
if proj:
|
||||
if metadata:
|
||||
what['project'] = xpath_prj
|
||||
else:
|
||||
what['project_id'] = xpath_prj
|
||||
try:
|
||||
res = search(apiurl, **what)
|
||||
|
Loading…
Reference in New Issue
Block a user