Commit 45a935e1 authored by Etienne Lessard's avatar Etienne Lessard

trunk: add test before deleting staticsip row

parent 6c93fc36
......@@ -72,19 +72,21 @@ class TrunkPersistor(CriteriaBuilderMixin):
.query(UserSIP)
.filter(UserSIP.id == trunk.protocolid)
.delete())
(self.session
.query(StaticSIP)
.filter(StaticSIP.id == trunk.registerid)
.delete())
if trunk.registerid:
(self.session
.query(StaticSIP)
.filter(StaticSIP.id == trunk.registerid)
.delete())
elif trunk.protocol == 'iax':
(self.session
.query(UserIAX)
.filter(UserIAX.id == trunk.protocolid)
.delete())
(self.session
.query(StaticIAX)
.filter(StaticIAX.id == trunk.registerid)
.delete())
if trunk.registerid:
(self.session
.query(StaticIAX)
.filter(StaticIAX.id == trunk.registerid)
.delete())
elif trunk.protocol == 'custom':
(self.session
.query(UserCustom)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment