def get_user_client(user_or_contact):
    """Returns the client of the contact of a Plone user

    If the user passed in has no contact or does not belong to any client,
    returns None.

    :param: Plone user or contact
    :returns: Client the contact of the Plone user belongs to
    """
    if not user_or_contact or ILabContact.providedBy(user_or_contact):
        # Lab contacts cannot belong to a client
        return None

    if not IContact.providedBy(user_or_contact):
        contact = get_user_contact(user_or_contact, contact_types=['Contact'])
        if IContact.providedBy(contact):
            return get_user_client(contact)
        return None

    client = get_parent(user_or_contact)
    if client and IClient.providedBy(client):
        return client

    return None
def get_user_client ( user_or_contact ) : if not user_or_contact or ILabContact . providedBy ( user_or_contact ) : return None if not IContact . providedBy ( user_or_contact ) : contact = get_user_contact ( user_or_contact , contact_types = [ 'Contact' ] ) if IContact . providedBy ( contact ) : return get_user_client ( contact ) return None client = get_parent ( user_or_contact ) if client and IClient . providedBy ( client ) : return client return None
Returns the client of the contact of a Plone user

    If the user passed in has no contact or does not belong to any client,
    returns None.

    :param: Plone user or contact
    :returns: Client the contact of the Plone user belongs to