From df9a735d25d0647a0a4af464927f9a4e05fddc67 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Aug 2018 10:51:17 +0300 Subject: [PATCH] fix --- abonapp/models.py | 3 ++- agent/mod_mikrotik.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/abonapp/models.py b/abonapp/models.py index ee22b0a..17b1aef 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -223,7 +223,8 @@ class Abon(BaseAccount): else: trf = abon_tariff.tariff agent_trf = TariffStruct(trf.id, trf.speedIn, trf.speedOut) - return AbonStruct(self.pk, abon_addresses, agent_trf, self.is_access()) + if len(abon_addresses) > 0: + return AbonStruct(self.pk, abon_addresses, agent_trf, self.is_access()) def sync_with_nas(self, created: bool) -> Optional[Exception]: agent_abon = self.build_agent_struct() diff --git a/agent/mod_mikrotik.py b/agent/mod_mikrotik.py index d3e456d..c33790c 100644 --- a/agent/mod_mikrotik.py +++ b/agent/mod_mikrotik.py @@ -247,6 +247,8 @@ class MikrotikTransmitter(BaseTransmitter, ApiRos, metaclass=type('_ABC_Lazy_mcs tariff=t, is_access=disabled or False ) + if len(a.ips) < 1: + return a.queue_id = info.get('=.id') return a except ValueError as e: