1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #4363: Standardize secret creation URL

This commit is contained in:
Jeremy Stretch
2020-03-12 21:14:14 -04:00
parent 5e971994ff
commit a28509019a
7 changed files with 20 additions and 20 deletions

View File

@ -71,6 +71,12 @@ class SecretRoleCSVForm(forms.ModelForm):
#
class SecretForm(BootstrapMixin, CustomFieldModelForm):
device = DynamicModelChoiceField(
queryset=Device.objects.all(),
widget=APISelect(
api_url="/api/dcim/devices/"
)
)
plaintext = forms.CharField(
max_length=SECRET_PLAINTEXT_MAX_LENGTH,
required=False,
@ -100,7 +106,7 @@ class SecretForm(BootstrapMixin, CustomFieldModelForm):
class Meta:
model = Secret
fields = [
'role', 'name', 'plaintext', 'plaintext2', 'tags',
'device', 'role', 'name', 'plaintext', 'plaintext2', 'tags',
]
def __init__(self, *args, **kwargs):