Ver Fonte

Fixes #14817: Relax required fields for IKE & IPSec models on bulk import

Jeremy Stretch há 2 anos atrás
pai
commit
621c3ccfa4
1 ficheiros alterados com 8 adições e 4 exclusões
  1. 8 4
      netbox/vpn/forms/bulk_import.py

+ 8 - 4
netbox/vpn/forms/bulk_import.py

@@ -151,7 +151,8 @@ class IKEProposalImportForm(NetBoxModelImportForm):
     )
     )
     authentication_algorithm = CSVChoiceField(
     authentication_algorithm = CSVChoiceField(
         label=_('Authentication algorithm'),
         label=_('Authentication algorithm'),
-        choices=AuthenticationAlgorithmChoices
+        choices=AuthenticationAlgorithmChoices,
+        required=False
     )
     )
     group = CSVChoiceField(
     group = CSVChoiceField(
         label=_('Group'),
         label=_('Group'),
@@ -191,11 +192,13 @@ class IKEPolicyImportForm(NetBoxModelImportForm):
 class IPSecProposalImportForm(NetBoxModelImportForm):
 class IPSecProposalImportForm(NetBoxModelImportForm):
     encryption_algorithm = CSVChoiceField(
     encryption_algorithm = CSVChoiceField(
         label=_('Encryption algorithm'),
         label=_('Encryption algorithm'),
-        choices=EncryptionAlgorithmChoices
+        choices=EncryptionAlgorithmChoices,
+        required=False
     )
     )
     authentication_algorithm = CSVChoiceField(
     authentication_algorithm = CSVChoiceField(
         label=_('Authentication algorithm'),
         label=_('Authentication algorithm'),
-        choices=AuthenticationAlgorithmChoices
+        choices=AuthenticationAlgorithmChoices,
+        required=False
     )
     )
 
 
     class Meta:
     class Meta:
@@ -209,7 +212,8 @@ class IPSecProposalImportForm(NetBoxModelImportForm):
 class IPSecPolicyImportForm(NetBoxModelImportForm):
 class IPSecPolicyImportForm(NetBoxModelImportForm):
     pfs_group = CSVChoiceField(
     pfs_group = CSVChoiceField(
         label=_('Diffie-Hellman group for Perfect Forward Secrecy'),
         label=_('Diffie-Hellman group for Perfect Forward Secrecy'),
-        choices=DHGroupChoices
+        choices=DHGroupChoices,
+        required=False
     )
     )
     proposals = CSVModelMultipleChoiceField(
     proposals = CSVModelMultipleChoiceField(
         queryset=IPSecProposal.objects.all(),
         queryset=IPSecProposal.objects.all(),