mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Fix Edit use case
This commit is contained in:
parent
e15638f7be
commit
734468fb99
@ -185,8 +185,14 @@ class CustomFieldChoiceSetForm(forms.ModelForm):
|
|||||||
extra_choices = [extra_choices]
|
extra_choices = [extra_choices]
|
||||||
choices = ""
|
choices = ""
|
||||||
for choice in extra_choices:
|
for choice in extra_choices:
|
||||||
choice_str = ":".join(choice.replace("'", "").replace(" ", "")[1:-1].split(","))
|
# Setup choices in Add Another use case
|
||||||
choices += choice_str + "\n"
|
if isinstance(choice, str):
|
||||||
|
choice_str = ":".join(choice.replace("'", "").replace(" ", "")[1:-1].split(","))
|
||||||
|
choices += choice_str + "\n"
|
||||||
|
# Setup choices in Edit use case
|
||||||
|
elif isinstance(choice, list):
|
||||||
|
choice_str = ":".join(choice)
|
||||||
|
choices += choice_str + "\n"
|
||||||
|
|
||||||
self.initial['extra_choices'] = choices
|
self.initial['extra_choices'] = choices
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user