Merge branch 'develop' into feature

This commit is contained in:
jeremystretch
2023-04-26 15:09:51 -04:00
32 changed files with 378 additions and 43 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ from django.utils.html import mark_safe
from django.utils.translation import gettext as _
from ipam.formfields import IPNetworkFormField
from ipam.validators import prefix_validator
from netbox.preferences import PREFERENCES
from utilities.forms import BootstrapMixin
from utilities.forms.widgets import DateTimePicker
@@ -105,7 +106,7 @@ class TokenForm(BootstrapMixin, forms.ModelForm):
help_text=_("If no key is provided, one will be generated automatically.")
)
allowed_ips = SimpleArrayField(
base_field=IPNetworkFormField(),
base_field=IPNetworkFormField(validators=[prefix_validator]),
required=False,
label=_('Allowed IPs'),
help_text=_('Allowed IPv4/IPv6 networks from where the token can be used. Leave blank for no restrictions. '