Fix sorting bug for Employee Time Sheet view
This commit is contained in:
parent
cab339e367
commit
df7fa9ddbd
|
@ -356,7 +356,7 @@ class TimeSheetView(View):
|
||||||
|
|
||||||
for employee in employees:
|
for employee in employees:
|
||||||
employee_shifts = sorted([s for s in shifts if s.employee_uuid == employee.uuid],
|
employee_shifts = sorted([s for s in shifts if s.employee_uuid == employee.uuid],
|
||||||
key=lambda s: (s.start_time, s.end_time))
|
key=lambda s: s.start_time)
|
||||||
if not hasattr(employee, 'weekdays'):
|
if not hasattr(employee, 'weekdays'):
|
||||||
employee.weekdays = [{} for day in weekdays]
|
employee.weekdays = [{} for day in weekdays]
|
||||||
setattr(employee, '{}_hours'.format(shift_type), datetime.timedelta(0))
|
setattr(employee, '{}_hours'.format(shift_type), datetime.timedelta(0))
|
||||||
|
|
Loading…
Reference in a new issue