diff --git a/.flake8 b/.flake8 index 5c92420..3f1d12a 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,6 @@ [flake8] max-line-length = 99 +ignore = E231 exclude = migrations, settings_local.py, manage.py, diff --git a/tpay_module/views.py b/tpay_module/views.py index f0b06a2..62acec8 100644 --- a/tpay_module/views.py +++ b/tpay_module/views.py @@ -44,8 +44,9 @@ def post(self, request, *args, **kwargs): # noqa: D102 payment_part = f'{payment.price.amount}{payment.number}' secure_code = getattr(settings, 'TPAY_SECURE_CODE', None) if secure_code: + id_part = data['id'] + data['tr_id'] probable_md5 = hashlib.md5( - f'{data["id"]}{data["tr_id"]}{payment_part}{secure_code}'.encode('utf-8'), + f'{id_part}{payment_part}{secure_code}'.encode('utf-8'), ).hexdigest() get_price = '{:.2f}'.format(float(request.POST['tr_paid'])) # noqa: P101 price_check = Decimal(get_price) == payment.price.amount