fixed guardian login edge cases and misleading placeholders on failed loads
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user