@simple_decorator
def valid_prefs_required(view_func):
 def _check_valid_prefs(request, *args, **kwargs):
  if request.user.is_authenticated():
   Profile.objects.get_or_create(user=request.user)
  return view_func(request, *args, **kwargs)
 return _check_valid_prefs

@ simple_decorator def valid_prefs_required ( view_func ) : def _check_valid_prefs ( request , * args , ** kwargs ) : if request . user . is_authenticated ( ) : Profile . objects . get_or_create ( user = request . user ) return view_func ( request , * args , ** kwargs ) return _check_valid_prefs
check whether the profile object exists .