You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When editing a subnet which has one or multiple level of children the overlap validation doesn't work as expected.
Here's how to replicate the issue:
create a subnet 10.0.0.0/16 (call it master subnet)
create a subnet 10.0.0.0/24 which has as master subnet the subnet created in the step above
create a subnet 10.0.1.0/24 which has as master subnet the subnet created in the first step
open the master subnet 10.0.0.0/16, change the description, hit save
When a subnet is
Expected result:
The change is saved.
Actual result:
ValidationError is raised:
Possible solution:
first of all a failing test which replicates the bug should be written.
then we need to make _validate_overlapping_subnets and make it exclude children, eg: qs = qs.exclude(pk__in=exclude).exclude(subnet=self.subnet, master_subnet=self, master_subnet__master_subnet=self)
however, the solution proposed in the previous point will work only for 2 level nesting and not for more, so we have to find a solution that can traverse the available parents and if it finds that the last parent is itself the validation skips
The text was updated successfully, but these errors were encountered:
When editing a subnet which has one or multiple level of children the overlap validation doesn't work as expected.
Here's how to replicate the issue:
When a subnet is
Expected result:
The change is saved.
Actual result:
ValidationError is raised:
Possible solution:
_validate_overlapping_subnets
and make it exclude children, eg:qs = qs.exclude(pk__in=exclude).exclude(subnet=self.subnet, master_subnet=self, master_subnet__master_subnet=self)
The text was updated successfully, but these errors were encountered: