Changes to the username displayment
This commit is contained in:
+1
-10
@@ -4491,7 +4491,6 @@ def api_item_detail(item_id):
|
||||
db = client[MONGODB_DB]
|
||||
ausleihungen_col = db['ausleihungen']
|
||||
items_col = db['items']
|
||||
student_cards_col = db['student_cards']
|
||||
|
||||
# Determine parent/group id (if this is a child, use its ParentItemId)
|
||||
parent_id = str(item.get('ParentItemId') or str(item.get('_id')))
|
||||
@@ -4532,15 +4531,7 @@ def api_item_detail(item_id):
|
||||
def get_borrower_name(user_raw):
|
||||
if not user_raw:
|
||||
return ''
|
||||
try:
|
||||
user_doc = student_cards_col.find_one({'_id': ObjectId(user_raw)})
|
||||
if user_doc:
|
||||
if user_doc.get('SchülerName'):
|
||||
return decrypt_text(str(user_doc.get('SchülerName', '')))
|
||||
return str(user_doc.get('AusweisId', ''))
|
||||
except Exception:
|
||||
pass
|
||||
return str(user_raw)
|
||||
return _display_username(user_raw)
|
||||
|
||||
# Prefer the most recent active borrower across the group
|
||||
borrower_value = ''
|
||||
|
||||
Reference in New Issue
Block a user