mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[MIG] pingen: Migration to 16.0
Standard migration, incl. changes proposed in https://github.com/OCA/report-print-send/pull/290/ Add unit test.
This commit is contained in:
@@ -17,12 +17,12 @@ _logger = logging.getLogger(__name__)
|
||||
class PingenController(http.Controller):
|
||||
def _verify_signature(self, request_content):
|
||||
webhook_signature = http.request.httprequest.headers.get("Signature")
|
||||
companies = (
|
||||
http.request.env["res.company"]
|
||||
.sudo()
|
||||
.search([("pingen_webhook_secret", "!=", False)])
|
||||
)
|
||||
companies = http.request.env["res.company"].sudo().search([])
|
||||
for company in companies:
|
||||
# We could not search on `pingen_webhook_secret
|
||||
# if this field is computed (e.g. env field)
|
||||
if not company.pingen_webhook_secret:
|
||||
continue
|
||||
secret_signature = hmac.new(
|
||||
company.pingen_webhook_secret.encode("utf-8"),
|
||||
request_content,
|
||||
|
||||
Reference in New Issue
Block a user