Skip to content

Commit

Permalink
Simplify help text replacement string for component forms with 'modul…
Browse files Browse the repository at this point in the history
…e' field
  • Loading branch information
bctiemann committed Nov 8, 2024
1 parent ba7dbcf commit d6bde32
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions netbox/dcim/forms/object_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ def __init__(self, *args, **kwargs):

# 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()
Expand Down

0 comments on commit d6bde32

Please sign in to comment.