fix: shift fetching fails in Employee Checkin if shift assignment has an end date

Co-authored-by: Ejaaz Khan <ejaazrkhan@gmail.com>
This commit is contained in:
Rucha Mahabal 2022-04-19 13:17:36 +05:30
parent 143067f5a7
commit 98cccf221e

View File

@ -251,7 +251,7 @@ def get_shifts_for_date(employee: str, for_timestamp: datetime) -> List[Dict[str
Criterion.any( Criterion.any(
[ [
assignment.end_date.isnull(), assignment.end_date.isnull(),
(assignment.end_date.isnotnull() & (getdate(for_timestamp.date()) >= assignment.end_date)), (assignment.end_date.isnotnull() & (getdate(for_timestamp.date()) <= assignment.end_date)),
] ]
) )
) )