def delete_users_with_profile(profile_name):
    users = world.ws.users.list()
    profiles = [profile for profile in world.ws.cti_profiles.list() if profile.name == profile_name]

    if not profiles:
        raise NoSuchProfileException('The CTI profile %s does not exist.' % profile_name)

    profile_id = profiles[0].id
    for user in users:
        if user.client_profile_id == profile_id:
            if user.voicemail:
                voicemail_helper.delete_voicemail_with_user_id(user.id)
            delete_user_line_extension_with_user_id(user.id)
Пример #2
0
def delete_users_with_profile(profile_name):
    users = world.ws.users.list()
    profiles = [
        profile for profile in world.ws.cti_profiles.list()
        if profile.name == profile_name
    ]

    if not profiles:
        raise NoSuchProfileException('The CTI profile %s does not exist.' %
                                     profile_name)

    profile_id = profiles[0].id
    for user in users:
        if user.client_profile_id == profile_id:
            if user.voicemail:
                voicemail_helper.delete_voicemail_with_user_id(user.id)
            delete_user_line_extension_with_user_id(user.id)
Пример #3
0
def _delete_voicemail_associations(user_id):
    voicemail_helper.delete_voicemail_with_user_id(user_id)
Пример #4
0
def _delete_voicemail_associations(user_id):
    voicemail_helper.delete_voicemail_with_user_id(user_id)