def METHOD_NAME(message):
    if message.day_of_week is None:
        SESSION.delete(message)
    else:
        new_schedule, _ = get_scdule_from_day(message.day_of_week)
        message.scheduled_time = new_schedule
        SESSION.merge(message)
    SESSION.commit()
    SESSION.close()