fix broken lesson deletion when a task is assigned [#76404992]