From b88178926689004e2287bec9259a75b54f45fb9e Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Fri, 11 Mar 2022 22:43:08 +0100
Subject: [PATCH] Fix predicate and add missing import

---
 aleksis/apps/tezor/predicates.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/aleksis/apps/tezor/predicates.py b/aleksis/apps/tezor/predicates.py
index 4980926..e9fb75d 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
 
-- 
GitLab