def METHOD_NAME(shift_user_data: ShiftUserData):
    last_freeze_log_entry = (
        UpdateShiftUserDataLogEntry.objects.filter(
            new_values__attendance_mode=ShiftAttendanceMode.FROZEN,
            user=shift_user_data.user,
        )
        .order_by("-created_date")
        .first()
    )
    return (
        last_freeze_log_entry.old_values["attendance_mode"]
        if last_freeze_log_entry
        else ShiftAttendanceMode.FLYING
    )