예제 #1
0
def _check_parameter_references(voicemail):
    if not validator.is_existing_context(voicemail.context):
        raise errors.param_not_found('context', 'Context')
    if voicemail.language is not None and voicemail.language not in language_dao.find_all():
        raise errors.param_not_found('language', 'Language')
    if voicemail.timezone is not None and voicemail.timezone not in voicemail_dao.find_all_timezone():
        raise errors.param_not_found('timezone', 'Timezone')
예제 #2
0
def _check_nonexistent_parameters(voicemail):
    nonexistent_parameters = {}
    if not validator.is_existing_context(voicemail.context):
        nonexistent_parameters["context"] = voicemail.context
    if voicemail.language is not None and voicemail.language not in language_dao.find_all():
        nonexistent_parameters["language"] = voicemail.language
    if voicemail.timezone is not None and voicemail.timezone not in voicemail_dao.find_all_timezone():
        nonexistent_parameters["timezone"] = voicemail.timezone
    if nonexistent_parameters:
        raise NonexistentParametersError(**nonexistent_parameters)
예제 #3
0
def _check_nonexistent_parameters(voicemail):
    nonexistent_parameters = {}
    if not validator.is_existing_context(voicemail.context):
        nonexistent_parameters['context'] = voicemail.context
    if voicemail.language is not None and voicemail.language not in language_dao.find_all():
        nonexistent_parameters['language'] = voicemail.language
    if voicemail.timezone is not None and voicemail.timezone not in voicemail_dao.find_all_timezone():
        nonexistent_parameters['timezone'] = voicemail.timezone
    if nonexistent_parameters:
        raise NonexistentParametersError(**nonexistent_parameters)
예제 #4
0
def find_all_timezone():
    return voicemail_dao.find_all_timezone()
예제 #5
0
파일: services.py 프로젝트: jaunis/xivo-dao
def find_all_timezone():
    return voicemail_dao.find_all_timezone()