Skip to content

Commit

Permalink
fix(backend/attendance): allow from_time and to_time to be the same
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Sep 3, 2024
1 parent 9092dde commit d15d0d7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions backend/timed/tracking/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."))
Expand Down
7 changes: 0 additions & 7 deletions backend/timed/tracking/tests/test_attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d15d0d7

Please sign in to comment.