def METHOD_NAME(
    db_session, user_vetinari, user_ridcully, org_ankhmorpork, role
):
    is_owner = role == 'owner'
    ridcully_admin = models.AccountMembership(
        member=user_ridcully,
        account=org_ankhmorpork,
        granted_by=user_vetinari,
        is_owner=is_owner,
        record_type=MEMBERSHIP_RECORD_TYPE.INVITE,
    )
    db_session.add(ridcully_admin)
    db_session.commit()
    return ridcully_admin