This commit is contained in:
@@ -27,6 +27,19 @@ from Web.modules.database.settings import MongoClient
|
||||
import Web.modules.inventarsystem.data_protection as dp
|
||||
|
||||
|
||||
def is_library_item(item):
|
||||
"""
|
||||
Determines if an item belongs to the library system.
|
||||
Returns False for 'other', None, or empty ItemType (Inventory item).
|
||||
Returns True for any specific library type ('Buch', 'CD', 'DVD', etc.).
|
||||
"""
|
||||
if not item:
|
||||
return False
|
||||
item_type = item.get('ItemType', 'other')
|
||||
if not item_type:
|
||||
return False
|
||||
return str(item_type).strip().lower() != 'other'
|
||||
|
||||
def safe_decrypt_user(encrypted_user):
|
||||
"""
|
||||
Safely decrypt an encrypted username string.
|
||||
|
||||
Reference in New Issue
Block a user