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')
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)
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)
def find_all_timezone(): return voicemail_dao.find_all_timezone()
def find_all_timezone(): return voicemail_dao.find_all_timezone()