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

Update secrets API, views

This commit is contained in:
Jeremy Stretch
2020-09-18 16:58:51 -04:00
parent b2a14d4654
commit 0b33c53f47
7 changed files with 53 additions and 29 deletions

View File

@ -1,6 +1,7 @@
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from django import forms
from django.contrib.contenttypes.models import ContentType
from dcim.models import Device
from extras.forms import (
@ -142,10 +143,11 @@ class SecretForm(BootstrapMixin, CustomFieldModelForm):
class SecretCSVForm(CustomFieldModelCSVForm):
device = CSVModelChoiceField(
queryset=Device.objects.all(),
to_field_name='name',
help_text='Assigned device'
assigned_object_type = CSVModelChoiceField(
queryset=ContentType.objects.all(),
limit_choices_to=SECRET_ASSIGNMENT_MODELS,
to_field_name='model',
help_text='Side A type'
)
role = CSVModelChoiceField(
queryset=SecretRole.objects.all(),