|
@@ -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])
|
|
|
# Check that we are included in the IP pool.
|
|
|
- if not subnet.issubset(pool):
|
|
|
+ if not subnet in pool:
|
|
|
raise ValidationError('Subnet must be included in the IP pool.')
|
|
|
# Check that we don't conflict with existing subnets.
|
|
|
# TODO: use precise database query instead of querying all
|