Implemenmtation of the new encryption into the my borrowed funktion

This commit is contained in:
2026-07-31 21:21:43 +02:00
parent 3e26c691b1
commit c9fdf41e0b
+4 -10
View File
@@ -10269,22 +10269,17 @@ def my_borrowed_items():
# Get current time for comparison # Get current time for comparison
current_time = datetime.datetime.now() current_time = datetime.datetime.now()
# Check if user is admin
user_is_admin = False
if 'is_admin' in session:
user_is_admin = session['is_admin']
# Get items currently borrowed by the user (where Verfuegbar=false and User=username) # Get items currently borrowed by the user (where Verfuegbar=false and User=username)
borrowed_items = list(items_collection.find({'Verfuegbar': False, 'User': username})) borrowed_items = list(items_collection.find({'Verfuegbar': False, 'User': encrypt_text(username)}))
# Get active and planned ausleihungen for the user # Get active and planned ausleihungen for the user
active_ausleihungen = list(ausleihungen_collection.find({ active_ausleihungen = list(ausleihungen_collection.find({
'User': username, 'User': encrypt_text(username),
'Status': 'active' 'Status': 'active'
})) }))
planned_ausleihungen = list(ausleihungen_collection.find({ planned_ausleihungen = list(ausleihungen_collection.find({
'User': username, 'User': encrypt_text(username),
'Status': 'planned' 'Status': 'planned'
})) }))
@@ -10368,8 +10363,7 @@ def my_borrowed_items():
return render_template( return render_template(
'my_borrowed_items.html', 'my_borrowed_items.html',
items=active_items, items=active_items,
planned_items=planned_items, planned_items=planned_items
user_is_admin=user_is_admin
) )