def delete_voicemail(user): try: voicemail = voicemail_dao.get(user.voicemail_id) except LookupError: return else: voicemail_dao.delete(voicemail)
def test_delete_with_dialaction(self): voicemail = self.create_voicemail(number='42', context='default') incall = self.create_incall_for_voicemail(voicemail, did='42', context='from-extern') voicemail_dao.delete(voicemail) self.check_voicemail_table(voicemail.id) self.check_incall_associated_to_nothing(incall.id)
def delete(voicemail): validator.validate_delete(voicemail) voicemail_dao.delete(voicemail) notifier.deleted(voicemail) try: sysconfd_connector.delete_voicemail_storage(voicemail.number, voicemail.context) except Exception as e: raise SysconfdError(str(e))
def test_delete(self): voicemail = self.create_voicemail(number='42', context='default') voicemail_dao.delete(voicemail) self.check_voicemail_table(voicemail.id)