|
@@ -61,10 +61,8 @@ class IPSubnet(models.Model):
|
|
|
raise ValidationError('Unable to allocate an IP subnet in the specified pool: not enough space left.')
|
|
|
self.inet = first_free.subnet(SUBNET_SIZE, 1).next()
|
|
|
else:
|
|
|
- pool = IPSet([self.ip_pool.inet])
|
|
|
- subnet = IPSet([self.inet])
|
|
|
|
|
|
- if not subnet.issubset(pool):
|
|
|
+ if not subnet in pool:
|
|
|
raise ValidationError('Subnet must be included in the IP pool.')
|
|
|
|
|
|
|