Fix how we fetch employee history, for profile view

This commit is contained in:
Lance Edgar 2020-02-28 13:10:25 -06:00
parent 7b43164831
commit 6d929dd95a

View file

@ -261,7 +261,7 @@ class PeopleView(MasterView):
def get_context_employee_history(self, employee): def get_context_employee_history(self, employee):
data = [] data = []
if employee: if employee:
for history in sorted(employee.history, key=lambda h: h.start_date, reverse=True): for history in employee.sorted_history(reverse=True):
data.append({ data.append({
'uuid': history.uuid, 'uuid': history.uuid,
'start_date': six.text_type(history.start_date), 'start_date': six.text_type(history.start_date),