Compare commits

...

1 Commits

Author SHA1 Message Date
Aiirondev_dev 1299140823 Fix of the encryption processing with the Student class
Release Inventarsystem / release-docker (push) Successful in 2m14s
2026-08-16 13:17:20 +02:00
+11 -2
View File
@@ -4431,10 +4431,19 @@ def student_card_class_barcode_download():
db = client[cfg.MONGODB_DB]
student_cards = db['student_cards']
class_cards = list(student_cards.find({'Klasse': class_name}).sort('AusweisId', 1))
class_cards = [_decrypt_student_card_doc(card) for card in class_cards]
# 1. Alle Ausweise laden
all_cards = list(student_cards.find().sort('AusweisId', 1))
client.close()
# 2. Alle entschlüsseln
decrypted_cards = [_decrypt_student_card_doc(card) for card in all_cards]
# 3. Im Speicher nach der Klartext-Klasse filtern
class_cards = [
card for card in decrypted_cards
if card.get('Klasse', '').strip() == class_name
]
if not class_cards:
flash(f'Keine Ausweise für die Klasse "{class_name}" gefunden.', 'error')
return redirect(url_for('student_cards_admin'))