From e62dadfd223733871862950c89e832630b57dafc Mon Sep 17 00:00:00 2001 From: Mek Date: Sun, 12 Jan 2025 15:35:29 -0800 Subject: [PATCH] Fix My Loans count for My Books #10041 Uses correct variable `myloans` when counting patron's loans, rather than the uninitialized `loans` variable --- openlibrary/plugins/upstream/mybooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlibrary/plugins/upstream/mybooks.py b/openlibrary/plugins/upstream/mybooks.py index 821cd7b38f7..b7961598a22 100644 --- a/openlibrary/plugins/upstream/mybooks.py +++ b/openlibrary/plugins/upstream/mybooks.py @@ -61,7 +61,7 @@ def render_template(self, mb): if mb.me: myloans = get_loans_of_user(mb.me.key) - loans = web.Storage({"docs": [], "total_results": len(loans)}) + loans = web.Storage({"docs": [], "total_results": len(myloans)}) # TODO: should do in one web.ctx.get_many fetch for loan in myloans: # Book will be None if no OL edition exists for the book