diff --git a/aleksis/apps/tezor/predicates.py b/aleksis/apps/tezor/predicates.py index 4980926acb10b6d12db668e2601b0cb0443857df..e9fb75deeb3b67e7063152b13105afa77cd7d81d 100644 --- a/aleksis/apps/tezor/predicates.py +++ b/aleksis/apps/tezor/predicates.py @@ -4,6 +4,8 @@ from rules import predicate from .models.invoice import Invoice +User = get_user_model() + @predicate def is_own_invoice(user: User, obj: Invoice): """Predicate which checks if the invoice is linked to the current user.""" @@ -14,10 +16,10 @@ def has_no_payment_variant(user: User, obj: Invoice): """Predicate which checks that the invoice has no payment variant.""" return not obj.variant -@predicate def is_in_payment_status(status: str): """Predicate which checks whether the invoice is in a specific state.""" + @predicate def _predicate(user: User, obj: Invoice): return obj.status == status