1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00

/search/package returns all meta data for the packages,

/search/package_id only returns the names - and that's all that
interests us for requests.
before: 11s
after: 5s
This commit is contained in:
Stephan Kulow 2010-03-15 13:36:11 +01:00
parent 47beb996ff
commit 54513a23de

View File

@ -2632,9 +2632,9 @@ def get_user_projpkgs_request_list(apiurl, user, req_state=('new',), req_type=No
"""Return all new requests for all projects/packages where is user is involved""" """Return all new requests for all projects/packages where is user is involved"""
if not projpkgs: if not projpkgs:
res = get_user_projpkgs(apiurl, user, exclude_projects=exclude_projects) res = get_user_projpkgs(apiurl, user, exclude_projects=exclude_projects)
for i in res['project'].findall('project'): for i in res['project_id'].findall('project'):
projpkgs[i.get('name')] = [] projpkgs[i.get('name')] = []
for i in res['package'].findall('package'): for i in res['package_id'].findall('package'):
if not i.get('project') in projpkgs.keys(): if not i.get('project') in projpkgs.keys():
projpkgs.setdefault(i.get('project'), []).append(i.get('name')) projpkgs.setdefault(i.get('project'), []).append(i.get('name'))
xpath = '' xpath = ''
@ -4683,9 +4683,9 @@ def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, p
xpath_prj = xpath_join(xpath, excl_prj, op='and') xpath_prj = xpath_join(xpath, excl_prj, op='and')
what = {} what = {}
if pkg: if pkg:
what['package'] = xpath_pkg what['package_id'] = xpath_pkg
if proj: if proj:
what['project'] = xpath_prj what['project_id'] = xpath_prj
try: try:
res = search(apiurl, **what) res = search(apiurl, **what)
except urllib2.HTTPError, e: except urllib2.HTTPError, e: