mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 13:08:16 -06:00
Fix PEP8 compliance
This commit is contained in:
parent
ab3db69c97
commit
ed4368d6e4
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user