This commit is contained in:
+6
-1
@@ -9135,9 +9135,14 @@ def library_item_invoices(item_id):
|
|||||||
flash('Bibliotheksmedium nicht gefunden.', 'error')
|
flash('Bibliotheksmedium nicht gefunden.', 'error')
|
||||||
return redirect(url_for('library_loans_admin'))
|
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(
|
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': {}}
|
'InvoiceData': {'$exists': True, '$ne': {}}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user