Skip to content

Commit

Permalink
Fix validation of module token in component names
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Aug 5, 2024
1 parent febb5da commit 16ff371
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion netbox/dcim/forms/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def clean(self):
self.instance._disable_replication = True
return

module_bays = self._get_module_bay_tree(module_bay)

for templates, component_attribute in [
("consoleporttemplates", "consoleports"),
("consoleserverporttemplates", "consoleserverports"),
Expand All @@ -124,7 +126,6 @@ def clean(self):
_("Cannot install module with placeholder values in a module bay with no position defined.")
)

module_bays = self._get_module_bay_tree(template)
if len(module_bays) != template.name.count(MODULE_TOKEN):
raise forms.ValidationError(
_("Cannot install module with placeholder values in a module bay tree {level} in tree but {tokens} placeholders given.").format(
Expand Down

0 comments on commit 16ff371

Please sign in to comment.