osclib/core: provide project_remote_prefixed().
This commit is contained in:
parent
9f80ea19b0
commit
fd94254601
@ -726,6 +726,17 @@ def project_remote_apiurl(apiurl, project):
|
|||||||
|
|
||||||
return apiurl, project
|
return apiurl, project
|
||||||
|
|
||||||
|
def project_remote_prefixed(apiurl, apiurl_remote, project):
|
||||||
|
if apiurl_remote == apiurl:
|
||||||
|
return project
|
||||||
|
|
||||||
|
remotes = project_remote_list(apiurl)
|
||||||
|
for remote, remote_apiurl in remotes.items():
|
||||||
|
if remote_apiurl == apiurl_remote:
|
||||||
|
return remote + ':' + project
|
||||||
|
|
||||||
|
raise Exception('remote APIURL interconnect not configured for{}'.format(apiurl_remote))
|
||||||
|
|
||||||
def review_find_last(request, user, states=['all']):
|
def review_find_last(request, user, states=['all']):
|
||||||
for review in reversed(request.reviews):
|
for review in reversed(request.reviews):
|
||||||
if review.by_user == user and ('all' in states or review.state in states):
|
if review.by_user == user and ('all' in states or review.state in states):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user