def _is_user_profile_visible(self, user=None):
 try:
  if hasattr(self, u'is_private'):
   is_private = self.is_private
  else:
   is_private = self.get_profile().is_private
  return ((user and ((user == self) or user.is_staff)) or (not is_private))
 except Profile.DoesNotExist:
  return True

def _is_user_profile_visible ( self , user = None ) : try : if hasattr ( self , u'is_private' ) : is_private = self . is_private else : is_private = self . get_profile ( ) . is_private return ( ( user and ( ( user == self ) or user . is_staff ) ) or ( not is_private ) ) except Profile . DoesNotExist : return True
get whether or not a users profile is viewable by a given user .