Fixed error on saving attendance where it was sending date as string not datetime.datetime

This commit is contained in:
Tanshu 2012-12-01 14:57:53 +05:30
parent 9a8e504e46
commit a4d8ae3c6a

View File

@ -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)\