From 10f863dba7736069dcc1a9ba1d6d4b20d95792aa Mon Sep 17 00:00:00 2001 From: bashmak Date: Sat, 8 Apr 2017 12:26:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D0=B0=D0=B2=D0=B8=D0=BC=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BA=D1=83=20=D0=BE=20dhcp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dhcp_lever.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhcp_lever.py b/dhcp_lever.py index f168f39..9dcc4df 100755 --- a/dhcp_lever.py +++ b/dhcp_lever.py @@ -46,7 +46,7 @@ def dhcp_commit(client_ip, client_mac, switch_mac, switch_port): try: abon = Abon.objects.get(opt82=opt82) abon.ip_address = get_or_create_pool_item(client_ip) - Abon.is_dhcp = True + abon.is_dhcp = True abon.save(update_fields=['ip_address']) print(_('Ip address update for %s successfull') % abon.get_short_name()) except Abon.DoesNotExist: @@ -58,6 +58,7 @@ def dhcp_expiry(client_ip): ip_item = IpPoolItem.objects.get(ip=client_ip) abon = Abon.objects.get(ip_address=ip_item) abon.ip_address = None + abon.is_dhcp = True abon.save(update_fields=['ip_address']) except IpPoolItem.DoesNotExist: pass