mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56: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.
|
||||
if 'module' in self.fields:
|
||||
help_text_parts = []
|
||||
if self.fields['name'].help_text:
|
||||
help_text_parts.append(self.fields['name'].help_text)
|
||||
help_text_parts.append(_(
|
||||
"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])
|
||||
self.fields['name'].help_text = _(
|
||||
"Alphanumeric ranges are supported for bulk creation. Mixed cases and types within a single range are "
|
||||
"not supported (example: <code>[ge,xe]-0/0/[0-9]</code>). The string <code>{module}</code> will be "
|
||||
"replaced with the position of the assigned module, if any."
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
super().clean()
|
||||
|
Loading…
Reference in New Issue
Block a user