1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-24 07:08:53 +02:00

- fix search of requests "I" created. fixes obs#1002

This is using the request collection api call now instead of xpath query.
More searches should be adapted similar most likely.

"osc my sr" is not a good name for this since it is not limited to
submit actions. But "osc my rq" is used for incoming requests.
This commit is contained in:
2015-07-29 11:05:05 +02:00
parent 083f23f77b
commit f7cfe4cdc8
3 changed files with 25 additions and 2 deletions

View File

@@ -4133,6 +4133,28 @@ def get_review_list(apiurl, project='', package='', byuser='', bygroup='', bypro
requests.append(r)
return requests
# this function uses the logic in the api which is faster and more exact then the xpath search
def get_request_collection(apiurl, role=None, req_who=None, req_states=('new', 'review', 'declined')):
query={ "view" : "collection" }
if role:
query["roles"] = role
if req_who:
query["user"] = req_who
query["states"] = ",".join(req_states)
u = makeurl(apiurl, ['request'], query)
f = http_GET(u)
res = ET.parse(f).getroot()
requests = []
for root in res.findall('request'):
r = Request()
r.read(root)
requests.append(r)
return requests
def get_exact_request_list(apiurl, src_project, dst_project, src_package=None, dst_package=None, req_who=None, req_state=('new', 'review', 'declined'), req_type=None):
xpath = ''
if not 'all' in req_state: