def get_profile_visibility(user_profile, user, configuration=None):
 if user_profile.requires_parental_consent():
  return PRIVATE_VISIBILITY
 if (not configuration):
  configuration = settings.ACCOUNT_VISIBILITY_CONFIGURATION
 profile_privacy = UserPreference.get_value(user, ACCOUNT_VISIBILITY_PREF_KEY)
 return (profile_privacy if profile_privacy else configuration.get('default_visibility'))

def get_profile_visibility ( user_profile , user , configuration = None ) : if user_profile . requires_parental_consent ( ) : return PRIVATE_VISIBILITY if ( not configuration ) : configuration = settings . ACCOUNT_VISIBILITY_CONFIGURATION profile_privacy = UserPreference . get_value ( user , ACCOUNT_VISIBILITY_PREF_KEY ) return ( profile_privacy if profile_privacy else configuration . get ( 'default_visibility' ) )
returns the visibility level for the specified user profile .