fix: Aufteilung – Tabelle volle Breite, Torte darunter; ungültige Eingaben inline (A13-T5)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-29 16:29:24 +02:00
co-authored by Claude Opus 5.5
parent 2a62bdca6c
commit 4b6144d812
4 changed files with 21 additions and 12 deletions
+2 -2
View File
@@ -392,7 +392,7 @@ def _parse_monat(value: str | None, today: date) -> date | None:
if not value:
return today.replace(day=1)
m = re.fullmatch(r"(\d{4})-(\d{2})", value.strip())
if not m or not 1 <= int(m.group(2)) <= 12:
if not m or not 1 <= int(m.group(2)) <= 12 or int(m.group(1)) < 1:
return None
return date(int(m.group(1)), int(m.group(2)), 1)
@@ -429,7 +429,7 @@ def _aufteilung_context(session: Session, today: date, monat: str | None,
ctx["monat_anzeige"] = month.strftime("%m.%Y")
scenario = None
if szenario:
valid_id = szenario.isdigit() and len(szenario) <= 9 # kein Integer-Überlauf in der DB
valid_id = re.fullmatch(r"[0-9]{1,9}", szenario) # ASCII, kein Integer-Überlauf
scenario = session.get(Scenario, int(szenario)) if valid_id else None
if scenario is None:
ctx["error"] = "Unbekanntes Szenario – bitte neu wählen."