From dadf6efdf7da8938028b008cd61de1e299446464 Mon Sep 17 00:00:00 2001 From: mayar osama Date: Wed, 24 Apr 2024 14:48:21 +0200 Subject: [PATCH] fix remove holiday bug incase adding and removing 1 holiday with a 1 exisiting holiday --- server/cshr/views/vacations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/cshr/views/vacations.py b/server/cshr/views/vacations.py index c76a0b53..595f2e1f 100644 --- a/server/cshr/views/vacations.py +++ b/server/cshr/views/vacations.py @@ -135,7 +135,7 @@ def post(self, request: Request) -> Response: location=location, holiday_date__in=public_holidays ).values_list("id", flat=True) - if len(public_holidays) < len(balance[0].public_holidays.all()): + if len(public_holidays) <= len(balance[0].public_holidays.all()): deleted_holidays = [] for holiday in balance[0].public_holidays.all(): if holiday.id not in public_holidays: