Skip to content

Commit

Permalink
fix: concurrency issue leading to duplicate attendance insertion (#2041)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal authored Aug 6, 2024
1 parent 5fdfbbd commit b4db5ac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hrms/hr/doctype/attendance/attendance.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def get_duplicate_attendance_record(self) -> str | None:
& (Attendance.attendance_date == self.attendance_date)
& (Attendance.name != self.name)
)
.for_update()
)

if self.shift:
Expand Down

0 comments on commit b4db5ac

Please sign in to comment.