slight database mixup fix
Release Inventarsystem / release-docker (push) Successful in 2m14s

This commit is contained in:
2026-08-19 19:57:13 +02:00
parent c06473644a
commit 9e77b4604d
+6 -1
View File
@@ -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': {}}
},
{