stagingapi: Don't do any change for excluded request

If the reqeust was in the excluded list, those can not be change the
state or any other action on them, therefore ignores them during
superseding.
This commit is contained in:
Max Lin 2019-11-22 18:53:06 +08:00
parent 3b00aaf262
commit ec3a4a0447

View File

@ -535,9 +535,15 @@ class StagingAPI(object):
if not target_requests:
target_requests = []
stage_info, code = self.superseded_request(request, target_requests)
request_id = int(request.get('id'))
# do not process the request has been excluded
requests_ignored = self.get_ignored_requests()
requests_ignored = [rq for rq in requests_ignored.keys()]
if request_id in requests_ignored:
return False, False
stage_info, code = self.superseded_request(request, target_requests)
if stage_info and (code is None or code == 'unstage'):
# Remove the old request
self.rm_from_prj(stage_info['prj'],