From f5638176818fb52d5b5f3667aac94443ac2984ad Mon Sep 17 00:00:00 2001 From: Aly Badr Date: Wed, 1 Sep 2021 14:14:03 +0200 Subject: [PATCH] patrons: ignore created loans at patrons deletion Co-Authored-by: Aly Badr --- rero_ils/modules/patrons/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rero_ils/modules/patrons/api.py b/rero_ils/modules/patrons/api.py index ca9938db8b..f64564f7b8 100644 --- a/rero_ils/modules/patrons/api.py +++ b/rero_ils/modules/patrons/api.py @@ -475,7 +475,7 @@ def get_number_of_loans(self): """Get number of loans.""" from ..loans.api import LoanState exclude_states = [ - LoanState.CANCELLED, LoanState.ITEM_RETURNED] + LoanState.CANCELLED, LoanState.ITEM_RETURNED, LoanState.CREATED] if self.pid: results = current_circulation.loan_search_cls()\ .filter('term', patron_pid=self.pid)\