mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 20:06:25 -06:00
Simplify help text replacement string for component forms with 'module' field
This commit is contained in:
parent
ba7dbcfc4f
commit
d6bde32056
@ -57,13 +57,11 @@ class ComponentCreateForm(forms.Form):
|
|||||||
|
|
||||||
# Components attached to a module need to present this standardized substitution help text.
|
# Components attached to a module need to present this standardized substitution help text.
|
||||||
if 'module' in self.fields:
|
if 'module' in self.fields:
|
||||||
help_text_parts = []
|
self.fields['name'].help_text = _(
|
||||||
if self.fields['name'].help_text:
|
"Alphanumeric ranges are supported for bulk creation. Mixed cases and types within a single range are "
|
||||||
help_text_parts.append(self.fields['name'].help_text)
|
"not supported (example: <code>[ge,xe]-0/0/[0-9]</code>). The string <code>{module}</code> will be "
|
||||||
help_text_parts.append(_(
|
"replaced with the position of the assigned module, if any."
|
||||||
"The string <code>{module}</code> will be replaced with the position of the assigned module, if any."
|
)
|
||||||
))
|
|
||||||
self.fields['name'].help_text = ' '.join([str(x) for x in help_text_parts])
|
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
super().clean()
|
super().clean()
|
||||||
|
Loading…
Reference in New Issue
Block a user