Fixed: Attendance update was broken due to wrong comparison.
This commit is contained in:
@ -297,7 +297,7 @@ class Attendance(Base):
|
|||||||
def create(self):
|
def create(self):
|
||||||
old = DBSession.query(Attendance).filter(Attendance.date == self.date) \
|
old = DBSession.query(Attendance).filter(Attendance.date == self.date) \
|
||||||
.filter(Attendance.employee_id == self.employee_id) \
|
.filter(Attendance.employee_id == self.employee_id) \
|
||||||
.filter(Attendance.is_valid is True).first()
|
.filter(Attendance.is_valid == True).first()
|
||||||
if old is None or old.attendance_type != self.attendance_type:
|
if old is None or old.attendance_type != self.attendance_type:
|
||||||
if old is not None:
|
if old is not None:
|
||||||
old.is_valid = False
|
old.is_valid = False
|
||||||
|
|||||||
Reference in New Issue
Block a user