From 5b06f83cfcfefbe639fdc35a2baf5641a7a4cc0a Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 21 Oct 2025 12:36:53 +0300 Subject: [PATCH] Features: 1) None; Fixes: 1) Remove unused import of `AbstractGateway` from `payments/signals.py`; 2) Adjust type hints in `AbstractGateway` methods to use `Any` instead of `Transaction`; Extra: 1) Replace unused import of `Transaction` in `payments/gateways/__init__.py` with `Any`. --- payments/gateways/__init__.py | 6 +++--- payments/signals.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/payments/gateways/__init__.py b/payments/gateways/__init__.py index f4926b44..bd777365 100644 --- a/payments/gateways/__init__.py +++ b/payments/gateways/__init__.py @@ -1,4 +1,4 @@ -from payments.models import Transaction +from typing import Any class UnknownGatewayError(Exception): @@ -7,9 +7,9 @@ class UnknownGatewayError(Exception): class AbstractGateway: @staticmethod - def process_transaction(transaction: Transaction) -> None: + def process_transaction(transaction: Any) -> None: raise NotImplementedError @staticmethod - def process_callback(transaction: Transaction) -> None: + def process_callback(transaction: Any) -> None: raise NotImplementedError diff --git a/payments/signals.py b/payments/signals.py index 43fc689d..32e3dd59 100644 --- a/payments/signals.py +++ b/payments/signals.py @@ -5,7 +5,6 @@ from typing import Any from django.db.models.signals import post_save from django.dispatch import receiver -from payments.gateways import AbstractGateway from payments.models import Balance, Transaction from payments.utils.emailing import balance_deposit_email from vibes_auth.models import User