Should this not be "if view is None:" ?