From d15d0d7ca4fd16230464024e41153fa00c5a3a5b Mon Sep 17 00:00:00 2001 From: Arthur Deierlein Date: Tue, 3 Sep 2024 15:57:27 +0200 Subject: [PATCH] fix(backend/attendance): allow from_time and to_time to be the same --- backend/timed/tracking/serializers.py | 5 ----- backend/timed/tracking/tests/test_attendance.py | 7 ------- 2 files changed, 12 deletions(-) diff --git a/backend/timed/tracking/serializers.py b/backend/timed/tracking/serializers.py index f2030f4fa..2b31940c1 100644 --- a/backend/timed/tracking/serializers.py +++ b/backend/timed/tracking/serializers.py @@ -109,11 +109,6 @@ def validate(self, data): from_time = round_time(data.get("from_time", instance and instance.from_time)) to_time = round_time(data.get("to_time", instance and instance.to_time)) - if to_time == from_time: - raise ValidationError( - _("An attendance may not start and end at the same time.") - ) - # allow attendances to end at midnight (00:00) if to_time < from_time and to_time != time(0, 0): raise ValidationError(_("An attendance may not end before it starts.")) diff --git a/backend/timed/tracking/tests/test_attendance.py b/backend/timed/tracking/tests/test_attendance.py index 25fdc82fb..6703f303c 100644 --- a/backend/timed/tracking/tests/test_attendance.py +++ b/backend/timed/tracking/tests/test_attendance.py @@ -122,13 +122,6 @@ def test_attendance_delete(internal_employee_client): "07:00", "An attendance may not end before it starts.", ), - ( - time(7, 30), - time(8, 30), - "07:30", - "07:30", - "An attendance may not start and end at the same time.", - ), ], ) def test_attendance_validation(