Remove a period's days along with the period
Deleting a period left every day it had funded behind. The link from a day back to its period was set to null the instant the period was deleted, so the days became untraceable before anything could clean them up, and the next recalculation had no way to know they no longer belonged to anything. Undo had the same fault for the same reason: the period went, the days stayed, and a reload showed them still there. The days are now removed with the period, before the link can be broken. A day pinned by hand goes too — pinning keeps the planner from quietly retyping a day, not from being deleted when you delete the period it belongs to, which is already how an unplanned band behaves.
This commit is contained in:
@@ -135,7 +135,7 @@ def _build_services(conn: aiosqlite.Connection) -> DemoServices:
|
||||
child=ChildService(children),
|
||||
vacation=VacationDaysService(vacation_repo),
|
||||
day_override=DayOverrideService(day_overrides),
|
||||
leave_wish=LeaveWishService(leave_wishes),
|
||||
leave_wish=LeaveWishService(leave_wishes, planned_leave),
|
||||
manual_fetch=ManualFetchService(parental_leave),
|
||||
planning=PlanningService(planned_leave, analytics, parental_leave, vacation_repo),
|
||||
users=users,
|
||||
|
||||
Reference in New Issue
Block a user