mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Merge branch 'develop' into 2921-tags-select2
This commit is contained in:
5
netbox/secrets/constants.py
Normal file
5
netbox/secrets/constants.py
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Secrets
|
||||
#
|
||||
|
||||
SECRET_PLAINTEXT_MAX_LENGTH = 65535
|
||||
@@ -9,6 +9,7 @@ from utilities.forms import (
|
||||
APISelect, APISelectMultiple, BootstrapMixin, FilterChoiceField, FlexibleModelChoiceField, SlugField,
|
||||
StaticSelect2Multiple, TagFilterField
|
||||
)
|
||||
from .constants import *
|
||||
from .models import Secret, SecretRole, UserKey
|
||||
|
||||
|
||||
@@ -69,7 +70,7 @@ class SecretRoleCSVForm(forms.ModelForm):
|
||||
|
||||
class SecretForm(BootstrapMixin, CustomFieldForm):
|
||||
plaintext = forms.CharField(
|
||||
max_length=65535,
|
||||
max_length=SECRET_PLAINTEXT_MAX_LENGTH,
|
||||
required=False,
|
||||
label='Plaintext',
|
||||
widget=forms.PasswordInput(
|
||||
@@ -79,7 +80,7 @@ class SecretForm(BootstrapMixin, CustomFieldForm):
|
||||
)
|
||||
)
|
||||
plaintext2 = forms.CharField(
|
||||
max_length=65535,
|
||||
max_length=SECRET_PLAINTEXT_MAX_LENGTH,
|
||||
required=False,
|
||||
label='Plaintext (verify)',
|
||||
widget=forms.PasswordInput()
|
||||
|
||||
@@ -29,5 +29,4 @@ class UserKeyFormTestCase(TestCase):
|
||||
data={'public_key': SSH_PUBLIC_KEY},
|
||||
instance=self.userkey,
|
||||
)
|
||||
print(form.is_valid())
|
||||
self.assertFalse(form.is_valid())
|
||||
|
||||
Reference in New Issue
Block a user