Personalisierung: Option anmeldung_anbieten im Check-in (ADR-0041, 18.10.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
53b60ad05a
commit
7d4812b3dc
1 file changed
+28
@@ -1601,6 +1601,8 @@ def fetch_auftragskatalog_state(device_id: str):
|
|||||||
optionen = decrypt_sensitive_optionen(optionen)
|
optionen = decrypt_sensitive_optionen(optionen)
|
||||||
if key == VEYON_MERKMAL and aktiv:
|
if key == VEYON_MERKMAL and aktiv:
|
||||||
optionen = veyon_optionen_anreichern(device_id, merkmal_id, optionen)
|
optionen = veyon_optionen_anreichern(device_id, merkmal_id, optionen)
|
||||||
|
if key == PERSONALISIERUNG_MERKMAL and aktiv:
|
||||||
|
optionen = {**optionen, "anmeldung_anbieten": personalisierung_anmeldung_anbieten(device_id)}
|
||||||
|
|
||||||
ergebnis.append({
|
ergebnis.append({
|
||||||
"merkmal": key,
|
"merkmal": key,
|
||||||
@@ -5912,6 +5914,32 @@ def personalisierung_verfallene_markieren(cur) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Merkmal "Personalisierung möglich": der Check-in sagt der Rolle in den
|
||||||
|
# Optionen, ob das Konto "Personalisierung" gerade angeboten wird (ADR-0041,
|
||||||
|
# Ergänzung 18.10.2026). Ein persönliches Konto pro Gerät: steht eins und
|
||||||
|
# läuft kein Code, verschwindet der Eintrag vom Anmeldebildschirm; ein neuer
|
||||||
|
# Code der Verwaltung holt ihn zurück.
|
||||||
|
PERSONALISIERUNG_MERKMAL = "personalisierung"
|
||||||
|
|
||||||
|
|
||||||
|
def personalisierung_anmeldung_anbieten(device_id: str) -> bool:
|
||||||
|
with get_database_connection() as conn:
|
||||||
|
with conn.cursor() as cur:
|
||||||
|
personalisierung_verfallene_markieren(cur)
|
||||||
|
cur.execute(
|
||||||
|
"""
|
||||||
|
SELECT
|
||||||
|
bool_or(status = ANY(%s)),
|
||||||
|
bool_or(status = 'angelegt' AND NOT entfernen)
|
||||||
|
FROM personalisierungen
|
||||||
|
WHERE device_id = %s
|
||||||
|
""",
|
||||||
|
(list(PERSONALISIERUNG_LAUFEND), device_id),
|
||||||
|
)
|
||||||
|
laufend, konto_vorhanden = cur.fetchone()
|
||||||
|
return bool(laufend) or not konto_vorhanden
|
||||||
|
|
||||||
|
|
||||||
PERSONALISIERUNG_SPALTEN = (
|
PERSONALISIERUNG_SPALTEN = (
|
||||||
"p.id, p.device_id, p.status, p.code_gueltig_bis, p.bestehenden_behalten, p.erstellt_von, "
|
"p.id, p.device_id, p.status, p.code_gueltig_bis, p.bestehenden_behalten, p.erstellt_von, "
|
||||||
"p.erstellt_am, p.email, p.anmeldename, p.eingereicht_am, p.bestaetigung_bis, p.bestaetigt_am, "
|
"p.erstellt_am, p.email, p.anmeldename, p.eingereicht_am, p.bestaetigung_bis, p.bestaetigt_am, "
|
||||||
|
|||||||
Reference in new issue
Block a user