Chaces to the Deleted Status, to reflekt the real active bookings in the menu
This commit is contained in:
+12
-4
@@ -9796,7 +9796,8 @@ def get_period_times(booking_date, period_num):
|
||||
@app.route('/my_borrowed_items')
|
||||
def my_borrowed_items():
|
||||
"""
|
||||
Zeigt alle vom aktuellen Benutzer ausgeliehenen und geplanten Objekte an.
|
||||
Zeigt alle vom aktuellen Benutzer ausgeliehenen und geplanten Objekte an,
|
||||
schließt jedoch soft-gelöschte Objekte (Deleted: True) aus.
|
||||
"""
|
||||
if 'username' not in session:
|
||||
flash('Bitte melden Sie sich an, um Ihre ausgeliehenen Objekte anzuzeigen', 'error')
|
||||
@@ -9837,7 +9838,11 @@ def my_borrowed_items():
|
||||
query_id = ObjectId(item_id)
|
||||
else:
|
||||
query_id = item_id
|
||||
item_obj = items_collection.find_one({'_id': query_id})
|
||||
|
||||
item_obj = items_collection.find_one({
|
||||
'_id': query_id,
|
||||
'Deleted': {'$ne': True}
|
||||
})
|
||||
except Exception:
|
||||
item_obj = None
|
||||
|
||||
@@ -9862,7 +9867,11 @@ def my_borrowed_items():
|
||||
elif status == 'planned':
|
||||
planned_items.append(item_obj)
|
||||
|
||||
all_borrowed_items = list(items_collection.find({'Verfuegbar': False}))
|
||||
all_borrowed_items = list(items_collection.find({
|
||||
'Verfuegbar': False,
|
||||
'Deleted': {'$ne': True}
|
||||
}))
|
||||
|
||||
for item in all_borrowed_items:
|
||||
raw_item_user = item.get('User', '')
|
||||
try:
|
||||
@@ -9879,7 +9888,6 @@ def my_borrowed_items():
|
||||
|
||||
client.close()
|
||||
|
||||
# DEBUG Logging
|
||||
app.logger.info(
|
||||
f"Passing {len(active_items)} active items and {len(planned_items)} planned items to template for user {username}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user