def get_profile_user_fieldname(profile_model=None, user_model=None):
    """
    Returns the name of the first field on the profile model that
    points to the ``auth.User`` model.
    """
    Profile = profile_model and get_profile_model()
    User = user_model or get_user_model()
    for field in Profile._meta.fields:
        if field.rel and field.rel.to == User:
            return field.name
    raise ImproperlyConfigured("Value for AUTH_PROFILE_MODULE does not "
                               "contain a ForeignKey field for auth.User: %s"
                               % Profile.__name__)
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/accounts/__init__.py/get_profile_user_fieldname/operator `or` -> `and`