From 9e77b4604d7a70a82ea1749cd609b2b43db65e0c Mon Sep 17 00:00:00 2001 From: AIIrondev Date: Wed, 19 Aug 2026 19:57:13 +0200 Subject: [PATCH] slight database mixup fix --- Web/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Web/app.py b/Web/app.py index 43695e9..742ed38 100755 --- a/Web/app.py +++ b/Web/app.py @@ -9135,9 +9135,14 @@ def library_item_invoices(item_id): flash('Bibliotheksmedium nicht gefunden.', 'error') return redirect(url_for('library_loans_admin')) + # Hole die ID sowohl als ObjectId als auch als String + item_id_obj = item_doc.get('_id') + item_id_str = str(item_id_obj) + borrow_docs = list(ausleihungen.find( { - 'Item': str(item_doc.get('_id')), + # $in sucht nach Treffern, egal ob die ID als String oder ObjectId in der DB steht + 'Item': {'$in': [item_id_str, item_id_obj]}, 'InvoiceData': {'$exists': True, '$ne': {}} }, {