Fixed
-
Editing a rotation or schedule after saving any condition no longer 500s.
Both edit forms seed their conditions textarea via{{ step.conditions | tojson }}. Flask's default JSON provider couldn't serialise Pydantic v2Conditioninstances, so the second a step gained a saved condition, the next edit re-render raisedObject of type Condition is not JSON serializableand hit the 500 page.Fixed by installing a
JSONProvidersubclass increate_app()that defersBaseModelinstances tomodel_dump()before falling through to the default. One-place patch, covers both/rotationsand/schedulesat the source, and any futurejsonify(model)use site for free.
Test coverage
Two regression tests in tests/test_rotation_routes.py:
- Save a rotation with a
time_windowcondition →GET /rotations?edit=<id>returns 200 with the condition data round-tripped through the textarea. - Same shape for
/schedules?edit=<id>with asuncondition.
Re-test in your install
Edit any rotation or schedule that already has a saved condition. The form should load cleanly instead of throwing a 500.
Full Changelog: v0.50.1...v0.50.2