fixed guardian login edge cases and misleading placeholders on failed loads

This commit is contained in:
2026-09-20 19:03:45 +02:00
parent 2423c1a75e
commit 630497abdd
23 changed files with 299 additions and 72 deletions
@@ -106,6 +106,18 @@ class _AbsenceFormState extends State<_AbsenceForm> {
// The child's identity is the whole point of the form, so a failed
// prefill is an error here, not a degraded start.
final prefill = await AbsencePrefill().run(childId: _childId);
// Name and class are readOnly in this mode, so a gap in the prefill
// cannot be filled by the user — say so instead of offering a form that
// can never be submitted.
if (prefill.firstName.trim().isEmpty ||
prefill.lastName.trim().isEmpty ||
prefill.className.trim().isEmpty) {
throw AbsencePrefillIncompleteException(
technicalDetails:
'childId=$_childId, class="${prefill.className}", '
'name="${prefill.firstName} ${prefill.lastName}"',
);
}
_classes = [prefill.className];
_applyPrefill(prefill, _classes);
return;