osclib/core: review_find_last(): provide states filter.
This commit is contained in:
parent
438b38fc0f
commit
cc03a35617
@ -708,9 +708,9 @@ def project_remote_apiurl(apiurl, project):
|
|||||||
|
|
||||||
return apiurl, project
|
return apiurl, project
|
||||||
|
|
||||||
def review_find_last(request, user):
|
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:
|
if review.by_user == user and ('all' in states or review.state in states):
|
||||||
return review
|
return review
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user