Skip to content

Commit e27d40b

Browse files
[fix] Auto-fill organization from master subnet in SubnetDivisionRule
1 parent d203490 commit e27d40b

File tree

1 file changed

+7
-0
lines changed
  • openwisp_controller/subnet_division/base

1 file changed

+7
-0
lines changed

openwisp_controller/subnet_division/base/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ def rule_class(self):
6969
return import_string(self.type)
7070

7171
def clean(self):
72+
# Auto-fill organization from master subnet
73+
if (
74+
self.master_subnet_id
75+
and self.master_subnet.organization is not None
76+
and not self.organization
77+
):
78+
self.organization = self.master_subnet.organization
7279
super().clean()
7380
self._validate_label()
7481
self._validate_master_subnet_validity()

0 commit comments

Comments
 (0)