Skip to content

Commit

Permalink
15257- Fix for exception not coming back correctly. (#1134)
Browse files Browse the repository at this point in the history
* Fix for exception not coming back correctly.

* Fix reference.
  • Loading branch information
seeker25 authored Mar 1, 2023
1 parent 93d0c09 commit c13aa15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jobs/payment-jobs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-e git+https://github.com/bcgov/sbc-common-components.git@a643801c373063dfa44a2f7213d9122d3ad03851#egg=sbc_common_components&subdirectory=python
-e git+https://github.com/seeker25/sbc-pay.git@aafc77ad4b1e0681f44580e14a4f559936c5d96e#egg=pay_api&subdirectory=pay-api
-e git+https://github.com/bcgov/sbc-pay.git@93d0c0955800001e1fb2229de3fd76ede62d4d54#egg=pay_api&subdirectory=pay-api
Flask-Caching==2.0.2
Flask-Migrate==2.7.0
Flask-Moment==1.0.5
Expand Down
16 changes: 9 additions & 7 deletions pay-api/src/pay_api/resources/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,12 @@ def post(account_number: str):

# Check if user is authorized to perform this action
check_auth(business_identifier=None, account_id=account_number, contains_role=EDIT_ROLE, is_premium=True)

report = Payment.create_payment_report(account_number, request_json, response_content_type, report_name)
response = Response(report, 201)
response.headers.set('Content-Disposition', 'attachment', filename=report_name)
response.headers.set('Content-Type', response_content_type)
response.headers.set('Access-Control-Expose-Headers', 'Content-Disposition')
return response
try:
report = Payment.create_payment_report(account_number, request_json, response_content_type, report_name)
response = Response(report, 201)
response.headers.set('Content-Disposition', 'attachment', filename=report_name)
response.headers.set('Content-Type', response_content_type)
response.headers.set('Access-Control-Expose-Headers', 'Content-Disposition')
return response
except BusinessException as exception:
return exception.response()

0 comments on commit c13aa15

Please sign in to comment.