fix: deleting empty planned work shifts
This commit is contained in:
@@ -73,6 +73,9 @@ class WorkShiftsPlanningService(BaseService):
|
|||||||
created_at=datetime.now(),
|
created_at=datetime.now(),
|
||||||
)
|
)
|
||||||
self.session.add(work_shift)
|
self.session.add(work_shift)
|
||||||
|
else:
|
||||||
|
if len(positions) == 0:
|
||||||
|
await self.session.delete(work_shift)
|
||||||
else:
|
else:
|
||||||
work_shift.positions = positions
|
work_shift.positions = positions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user