

def get_profile(user):
    ' Rather than throw an error on get_profile, we just return None.\n        Makes handling of anonymous users in non-loggedin areas easier.\n    '
    if user.is_anonymous():
        return None
    try:
        key = key_profile_getprofile(user)
        profile = cache.get(key)
        if (profile is not None):
            return profile
        profile = profile.get_profile()
        cache.set(key, profile, settings.CACHE_TIMEOUT)
        return profile
    except Profile.DoesNotExist:
        return None

dataset/ETHPy150Open pydanny/django-easy-profiles/easy_profiles/utils.py get_profile/VarMisuse@61/124 `user`->`profile`