Fixed error on saving attendance where it was sending date as string not datetime.datetime
This commit is contained in:
parent
9a8e504e46
commit
a4d8ae3c6a
@ -113,6 +113,10 @@ def employee_attendance_report(request):
|
||||
|
||||
|
||||
def employee_attendance(employee, start_date, finish_date):
|
||||
if not isinstance(start_date, datetime.datetime):
|
||||
start_date = datetime.datetime.strptime(start_date, '%d-%b-%Y')
|
||||
if not isinstance(finish_date, datetime.datetime):
|
||||
finish_date = datetime.datetime.strptime(finish_date, '%d-%b-%Y')
|
||||
list = []
|
||||
for item in daterange(start_date, finish_date, inclusive=True):
|
||||
att = DBSession.query(Attendance)\
|
||||
|
Loading…
Reference in New Issue
Block a user