Browse Source

fix error when no customers exists

devel
Dmitry Novikov 7 years ago
parent
commit
33272505af
  1. 5
      ip_pool/models.py

5
ip_pool/models.py

@ -146,7 +146,10 @@ class NetworkModel(models.Model):
continue continue
elif ip > work_range_end_ip: elif ip > work_range_end_ip:
break # Not found break # Not found
used_ip = next(employed_ips)
try:
used_ip = next(employed_ips)
except StopIteration:
return ip
if used_ip is None: if used_ip is None:
return ip return ip
used_ip = ip_address(used_ip) used_ip = ip_address(used_ip)

Loading…
Cancel
Save