Biblitoheksid is also convertet

This commit is contained in:
Aiirondev_dev committed 2026-11-01 17:08:22 +01:00
1 parent 79cf958c3c
commit 5c4ab6f0fc
2 files changed
+39 -17

No files matched your search

+11 -7
View File
@@ -695,13 +695,17 @@ def get_user_by_student_card(student_card_id):
if not normalized:
return None
client = MongoClient(cfg.MONGODB_HOST, cfg.MONGODB_PORT)
db = _get_tenant_db(client)
users = db['student_cards']
found_user = users.find_one({'AusweisId': normalized})
client.close()
# Do not call dp.decrypt_text() here because found_user is a MongoDB dictionary.
return found_user
try:
db = _get_tenant_db(client)
users = db['users']
return users.find_one({
'$or': [
{'StudentCardId': normalized},
{'StudentCardId': student_card_id},
]
})
finally:
client.close()
def get_user_by_student_ident(student_ident):
"""Return user dict by student ident by decrypting all cards and matching."""