Remove brackets in auth widget check.

This commit is contained in:
Alex Root Junior 2018-10-20 16:04:37 +03:00
parent 1d700f846e
commit 9474ddfa91

View file

@ -21,7 +21,7 @@ def generate_hash(data: dict, token: str) -> str:
secret = hashlib.sha256()
secret.update(token.encode('utf-8'))
sorted_params = collections.OrderedDict(sorted(data.items()))
msg = '\n'.join(["{}={}".format(k, v) for k, v in sorted_params.items() if k != 'hash'])
msg = '\n'.join("{}={}".format(k, v) for k, v in sorted_params.items() if k != 'hash')
return hmac.new(secret.digest(), msg.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()