fix hash generation to match what's done in the database (#9606)
This commit is contained in:
parent
dd6d7d3ebc
commit
298c15b67f
|
@ -8,7 +8,6 @@ import os
|
|||
import requests
|
||||
import logging
|
||||
from hashlib import sha256
|
||||
import hmac
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.conf import settings
|
||||
|
@ -57,9 +56,8 @@ class Command(BaseCommand):
|
|||
|
||||
|
||||
def get_invoice_hash(self, *args):
|
||||
hash = hmac.HMAC(self.secret, digestmod=sha256, msg=''.join(map(lambda s: str(s), args)))
|
||||
return hash.hexdigest()[:8]
|
||||
|
||||
msg = ''.join(map(lambda s: str(s), args)
|
||||
return sha256(msg).hexdigest()[:7]
|
||||
|
||||
def handle(self, *args, **options):
|
||||
if options['list']:
|
||||
|
|
Reference in New Issue