From 1ad95cfb287c2eb8338022c3145567e1d4a737e6 Mon Sep 17 00:00:00 2001
From: PSzczepanski1996
Date: Mon, 22 Jan 2024 13:15:42 +0100
Subject: [PATCH] Fix flake8 again
---
.flake8 | 1 +
tpay_module/views.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
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