Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b8923b4417 | |||
| a864bab713 |
@@ -7047,6 +7047,7 @@ def ausleihen(id):
|
|||||||
if current_permissions['actions'].get('can_borrow') and not is_library_item:
|
if current_permissions['actions'].get('can_borrow') and not is_library_item:
|
||||||
if student_card_id:
|
if student_card_id:
|
||||||
student_user = us.get_user_by_student_card(student_card_id)
|
student_user = us.get_user_by_student_card(student_card_id)
|
||||||
|
app.logger.debug(f"Borrowing on behalf of student card {student_card_id}: found user {student_user}")
|
||||||
if not student_user:
|
if not student_user:
|
||||||
flash('Keine Schülerin/kein Schüler mit dieser Ausweis-ID gefunden.', 'error')
|
flash('Keine Schülerin/kein Schüler mit dieser Ausweis-ID gefunden.', 'error')
|
||||||
return redirect(url_for('library'))
|
return redirect(url_for('library'))
|
||||||
|
|||||||
@@ -594,8 +594,8 @@ def student_card_exists(student_card_id):
|
|||||||
return False
|
return False
|
||||||
client = MongoClient(cfg.MONGODB_HOST, cfg.MONGODB_PORT)
|
client = MongoClient(cfg.MONGODB_HOST, cfg.MONGODB_PORT)
|
||||||
db = _get_tenant_db(client)
|
db = _get_tenant_db(client)
|
||||||
users = db['users']
|
users = db['student_cards']
|
||||||
exists = users.find_one({'StudentCardId': normalized}) is not None
|
exists = users.find_one({'SchülerName': normalized}) is not None
|
||||||
client.close()
|
client.close()
|
||||||
return exists
|
return exists
|
||||||
|
|
||||||
@@ -607,8 +607,8 @@ def get_user_by_student_card(student_card_id):
|
|||||||
return None
|
return None
|
||||||
client = MongoClient(cfg.MONGODB_HOST, cfg.MONGODB_PORT)
|
client = MongoClient(cfg.MONGODB_HOST, cfg.MONGODB_PORT)
|
||||||
db = _get_tenant_db(client)
|
db = _get_tenant_db(client)
|
||||||
users = db['users']
|
users = db['student_cards']
|
||||||
found_user = users.find_one({'StudentCardId': normalized})
|
found_user = users.find_one({'SchülerName': normalized})
|
||||||
client.close()
|
client.close()
|
||||||
return found_user
|
return found_user
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user