[FIX] website_sale_signifyd: refactor to actually change response code

This commit is contained in:
Jared Kipe
2021-06-16 06:09:01 -07:00
parent b5d33f9eeb
commit 1ff7062327

View File

@@ -2,7 +2,7 @@
import json import json
from odoo.http import Controller, request, route from odoo.http import Controller, request, route
from odoo.exceptions import MissingError from werkzeug.exceptions import NotFound
class SignifydWebhooks(Controller): class SignifydWebhooks(Controller):
@@ -22,7 +22,7 @@ class SignifydWebhooks(Controller):
if case_id == 1: if case_id == 1:
# Special case when verifying webhook. # Special case when verifying webhook.
return {'response': 'success'} return {'response': 'success'}
raise MissingError('CaseId: %s Cannot be found.' % (case_id, )) raise NotFound('CaseId: %s Cannot be found.' % (case_id,))
def _get_case(self, case_id): def _get_case(self, case_id):
return request.env['signifyd.case'].sudo().search([('case_id', '=', case_id)], limit=1) return request.env['signifyd.case'].sudo().search([('case_id', '=', case_id)], limit=1)