def get_overdue_tasks(*, db_session) -> List[Optional[Task]]:
    'Returns all tasks that have not been resolved and are past due date.'
    return db_session.query(Task).filter((Task.status == TaskStatus.open)).filter((Task.reminders == True)).filter((Task.resolve_by < datetime.utcnow())).filter(or_(((Task.last_reminder_at + timedelta(days=1)) < datetime.utcnow()), (Task.last_reminder_at == None))).all()
Returns all tasks that have not been resolved and are past due date.
def get_overdue_tasks(*, db_session) -> List[Optional[Task]]:
    
    return db_session.query(Task).filter((Task.status == TaskStatus.open)).filter((Task.reminders == True)).filter((Task.resolve_by < datetime.utcnow())).filter(or_(((Task.last_reminder_at + timedelta(days=1)) < datetime.utcnow()), (Task.last_reminder_at == None))).all()