diff --git a/netbox/netbox/api/authentication.py b/netbox/netbox/api/authentication.py index c73784029..efbce9997 100644 --- a/netbox/netbox/api/authentication.py +++ b/netbox/netbox/api/authentication.py @@ -26,7 +26,7 @@ class TokenAuthentication(authentication.TokenAuthentication): # Verify source IP is allowed request = self.request if len(token.allowed_ips) > 0 and request: -### Replace 'HTTP_X_REAL_IP' with the settings variable choosen in #8867 + # Replace 'HTTP_X_REAL_IP' with the settings variable choosen in #8867 if 'HTTP_X_REAL_IP' in request.META: clientip = request.META['HTTP_X_REAL_IP'].split(",")[0].strip() elif 'REMOTE_ADDR' in request.META: diff --git a/netbox/users/models.py b/netbox/users/models.py index 398b0d81d..7cdbce2b2 100644 --- a/netbox/users/models.py +++ b/netbox/users/models.py @@ -208,11 +208,11 @@ class Token(BigIDModel): max_length=200, blank=True ) - allowed_ips = betterArrayField( - base_field = IPNetworkField(), - blank = True, - null = True, - help_text = 'Allowed IPv4/IPv6 networks from where the token can be used. Leave blank for no restrictions. Ex: "10.1.1.0/24, 192.168.10.16/32, 2001:DB8:1::/64"', + allowed_ips=betterArrayField( + base_field=IPNetworkField(), + blank=True, + null=True, + help_text='Allowed IPv4/IPv6 networks from where the token can be used. Leave blank for no restrictions. Ex: "10.1.1.0/24, 192.168.10.16/32, 2001:DB8:1::/64"', ) class Meta: