mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Fix validation of module token in component names
This commit is contained in:
parent
febb5da4ab
commit
16ff3718bb
@ -100,6 +100,8 @@ class ModuleCommonForm(forms.Form):
|
|||||||
self.instance._disable_replication = True
|
self.instance._disable_replication = True
|
||||||
return
|
return
|
||||||
|
|
||||||
|
module_bays = self._get_module_bay_tree(module_bay)
|
||||||
|
|
||||||
for templates, component_attribute in [
|
for templates, component_attribute in [
|
||||||
("consoleporttemplates", "consoleports"),
|
("consoleporttemplates", "consoleports"),
|
||||||
("consoleserverporttemplates", "consoleserverports"),
|
("consoleserverporttemplates", "consoleserverports"),
|
||||||
@ -124,7 +126,6 @@ class ModuleCommonForm(forms.Form):
|
|||||||
_("Cannot install module with placeholder values in a module bay with no position defined.")
|
_("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):
|
if len(module_bays) != template.name.count(MODULE_TOKEN):
|
||||||
raise forms.ValidationError(
|
raise forms.ValidationError(
|
||||||
_("Cannot install module with placeholder values in a module bay tree {level} in tree but {tokens} placeholders given.").format(
|
_("Cannot install module with placeholder values in a module bay tree {level} in tree but {tokens} placeholders given.").format(
|
||||||
|
Loading…
Reference in New Issue
Block a user