From 8466b8138c1767bcfd4565c1159dc8cef4942b00 Mon Sep 17 00:00:00 2001 From: bashmak Date: Thu, 30 Mar 2017 16:30:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=82=D0=B0=D0=B9=D0=BC=D0=B0=D1=83=D1=82=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20ip=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D1=8B=20=D0=BF=D0=BE=20dhc?= =?UTF-8?q?p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abonapp/models.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/abonapp/models.py b/abonapp/models.py index a26cd8e..1f402b0 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -400,26 +400,25 @@ class AbonRawPassword(models.Model): def abon_post_save(sender, instance, **kwargs): - #try: + timeout = None + if hasattr(instance, 'opt82'): + timeout = 3600 tm = Transmitter() agent_abon = instance.build_agent_struct() if agent_abon is None: return True if kwargs['created']: # создаём абонента - tm.add_user(agent_abon) + tm.add_user(agent_abon, ip_timeout=timeout) else: # обновляем абонента на NAS - tm.update_user(agent_abon) + tm.update_user(agent_abon, ip_timeout=timeout) # если не активен то приостановим услугу if instance.is_active: tm.start_user(agent_abon) else: tm.pause_user(agent_abon) - #except NasFailedResult: - # return True - def abon_del_signal(sender, instance, **kwargs): try: