Skip to content

Commit

Permalink
Merge pull request #4628 from bcgov/dev-RQ-4606
Browse files Browse the repository at this point in the history
#4606 - Prevent saving processing requests to raw request table
  • Loading branch information
richard-aot authored Oct 25, 2023
2 parents 39822db + 342aa26 commit 478d14a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions request-management-api/request_api/resources/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def post(requestid=None, actiontype=None):
assigneelastname = requestdata['assigneelastname']

if int(requestid) and str(requestid) != "-1" :
status = rawrequestservice().getstatus(updaterequest)
status = rawrequestservice().getstatus(updaterequest)
if status not in ['Intake in Progress', 'Closed', 'Redirect', 'Peer Review']:
raise ValueError('Invalid request state.')
result = rawrequestservice().saverawrequestversion(updaterequest,requestid,assigneegroup,assignee,status,AuthHelper.getuserid(),assigneefirstname,assigneemiddlename,assigneelastname, actiontype)
assignee = ''
if(actiontype == 'assignee'):
Expand All @@ -109,8 +111,8 @@ def post(requestid=None, actiontype=None):
assignee = getassignee(assigneefirstname,assigneelastname,assigneegroup)
asyncio.ensure_future(eventservice().postevent(result.identifier,"rawrequest",AuthHelper.getuserid(),AuthHelper.getusername(),AuthHelper.isministrymember(),assignee))
return {'status': result.success, 'message':result.message,'id':result.identifier} , 200
except ValueError:
return {'status': 500, 'message':INVALID_REQUEST_ID}, 500
except ValueError as valuexception:
return {'status': 500, 'message':str(valuexception)}, 500
except BusinessException as exception:
return {'status': exception.status_code, 'message':exception.message}, 500

Expand Down

0 comments on commit 478d14a

Please sign in to comment.