2 Commits
Author SHA1 Message Date
maziggy 8e5116fe20 fix(api): null for a field that can't be empty leaves it unchanged
Update schemas declare fields `X | None = None` so a PATCH can leave
them out, and most routes treat null as "unchanged". About a dozen
(printers, smart plugs, queue items and bulk edits, archives,
filaments, spools, notification providers, GitHub backup, HA sensors,
maintenance, external links) applied model_dump(exclude_unset=True)
with setattr instead, wrote the null into a NOT NULL column and failed
with a 500.

A new base, IgnoresNullForRequiredColumns, drops such a null before
validation, using the NOT NULL flags of the table the schema names
(__orm_table__, resolved lazily), so every route treats it as not sent.
A null for a nullable column still clears it. 40 update schemas use it;
a guard test requires every PATCH/PUT body that writes a row to use it
or to be listed with a reason (suppliers keep their own 422 for a null
name).
2026-10-11 12:48:48 +02:00
MagicMelody84 54af3146a3 [Feature]: Bind Home Assistant sensors to storage locations (dryboxes/bins) (#2827) 2026-08-25 12:17:23 +02:00