|
|
@ -46,7 +46,7 @@ def dhcp_commit(client_ip, client_mac, switch_mac, switch_port): |
|
|
try: |
|
|
try: |
|
|
abon = Abon.objects.get(opt82=opt82) |
|
|
abon = Abon.objects.get(opt82=opt82) |
|
|
abon.ip_address = get_or_create_pool_item(client_ip) |
|
|
abon.ip_address = get_or_create_pool_item(client_ip) |
|
|
Abon.is_dhcp = True |
|
|
|
|
|
|
|
|
abon.is_dhcp = True |
|
|
abon.save(update_fields=['ip_address']) |
|
|
abon.save(update_fields=['ip_address']) |
|
|
print(_('Ip address update for %s successfull') % abon.get_short_name()) |
|
|
print(_('Ip address update for %s successfull') % abon.get_short_name()) |
|
|
except Abon.DoesNotExist: |
|
|
except Abon.DoesNotExist: |
|
|
@ -58,6 +58,7 @@ def dhcp_expiry(client_ip): |
|
|
ip_item = IpPoolItem.objects.get(ip=client_ip) |
|
|
ip_item = IpPoolItem.objects.get(ip=client_ip) |
|
|
abon = Abon.objects.get(ip_address=ip_item) |
|
|
abon = Abon.objects.get(ip_address=ip_item) |
|
|
abon.ip_address = None |
|
|
abon.ip_address = None |
|
|
|
|
|
abon.is_dhcp = True |
|
|
abon.save(update_fields=['ip_address']) |
|
|
abon.save(update_fields=['ip_address']) |
|
|
except IpPoolItem.DoesNotExist: |
|
|
except IpPoolItem.DoesNotExist: |
|
|
pass |
|
|
pass |
|
|
|