Skip to content

Commit af4c553

Browse files
Improve the variable naming for correspondence (GH-26)
2 parents 1a28b9d + c6a4de9 commit af4c553

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ following keys:
5353
- `OPTIONS` - a dictionary for additional settings
5454
- `VPN` - use VPN detection and forbid access to VPN users
5555
- `URL` - set of URLs to redirect to when the user is located in a forbidden country or using a VPN
56-
- `FORBIDDEN_LOC` - the URL to redirect to when the user is located in a forbidden country
57-
- `FORBIDDEN_VPN` - the URL to redirect to when the user is using a VPN
58-
- `FORBIDDEN_KIT` - the URL to redirect to when the user is using a forbidden device
56+
- `FORBIDDEN_LOC` - the URL to redirect to when the user is located in a forbidden geolocation
57+
- `FORBIDDEN_NET` - the URL to redirect to when the user is using a forbidden network (VPN)
58+
- `FORBIDDEN_DEV` - the URL to redirect to when the user is using a forbidden device
5959

6060
The available device types are: `smartphone`, `peripheral` - refers to all hardware components that are attached to a
6161
computer, `wearable` - common types of wearable technology include smartwatches and smartglasses, `phablet` - a
@@ -72,8 +72,8 @@ DJANGO_FORBID = {
7272
'VPN': True,
7373
'URL': {
7474
'FORBIDDEN_LOC': 'forbidden_location',
75-
'FORBIDDEN_VPN': 'forbidden_network',
76-
'FORBIDDEN_KIT': 'forbidden_device',
75+
'FORBIDDEN_NET': 'forbidden_network',
76+
'FORBIDDEN_DEV': 'forbidden_device',
7777
},
7878
},
7979
}

docs/integration/settings/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ following keys.
1212
- `OPTIONS` - a dictionary for additional settings
1313
- `VPN` - use VPN detection and forbid access to VPN users
1414
- `URL` - set of URLs to redirect to when the user is located in a forbidden country or using a VPN
15-
- `FORBIDDEN_LOC` - the URL to redirect to when the user is located in a forbidden country
16-
- `FORBIDDEN_VPN` - the URL to redirect to when the user is using a VPN
17-
- `FORBIDDEN_KIT` - the URL to redirect to when the user is using a forbidden device
15+
- `FORBIDDEN_LOC` - the URL to redirect to when the user is located in a forbidden geolocation
16+
- `FORBIDDEN_NET` - the URL to redirect to when the user is using a forbidden network (VPN)
17+
- `FORBIDDEN_DEV` - the URL to redirect to when the user is using a forbidden device
1818

1919
These variables are all covered in more detail at the [next page](./variables.md).
2020

@@ -32,8 +32,8 @@ DJANGO_FORBID = {
3232
'VPN': True,
3333
'URL': {
3434
'FORBIDDEN_LOC': 'forbidden_location',
35-
'FORBIDDEN_VPN': 'forbidden_network',
36-
'FORBIDDEN_KIT': 'forbidden_device',
35+
'FORBIDDEN_NET': 'forbidden_network',
36+
'FORBIDDEN_DEV': 'forbidden_device',
3737
},
3838
},
3939
}

docs/integration/settings/variables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ the default Django 403 page. The URL can be absolute or relative.
100100

101101
#### Forbidden Network
102102

103-
- Key: `FORBIDDEN_VPN`
103+
- Key: `FORBIDDEN_NET`
104104
- Type: `str`
105105
- Default: `''`
106106

107-
This URL is used when the user is using a virtual private network (VPN). If not specified, the user will see the default
108-
Django 403 page. The URL can be absolute or relative.
107+
This URL is used when the user is using a virtual private network (VPN) while VPN detection is enabled. If not
108+
specified, the user will see the default Django 403 page. The URL can be absolute or relative.
109109

110110
#### Forbidden Device
111111

112-
- Key: `FORBIDDEN_KIT`
112+
- Key: `FORBIDDEN_DEV`
113113
- Type: `str`
114114
- Default: `''`
115115

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ license_file = LICENSE
3030
platforms = unix, linux, osx, win32
3131
classifiers =
3232
Operating System :: OS Independent
33-
Development Status :: 4 - Beta
33+
Development Status :: 5 - Production/Stable
3434
Framework :: Django
3535
Framework :: Django :: 2.1
3636
Framework :: Django :: 2.2

src/django_forbid/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.9"
1+
__version__ = "0.1.0"

src/django_forbid/skills/forbid_device.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def __call__(self, request):
3939
if Access(devices).grants(device_type):
4040
return self.get_response(request)
4141

42-
# Redirects to the FORBIDDEN_KIT URL if set.
43-
if Settings.has("OPTIONS.URL.FORBIDDEN_KIT"):
44-
return redirect(Settings.get("OPTIONS.URL.FORBIDDEN_KIT"))
42+
# Redirects to the FORBIDDEN_DEV URL if set.
43+
if Settings.has("OPTIONS.URL.FORBIDDEN_DEV"):
44+
return redirect(Settings.get("OPTIONS.URL.FORBIDDEN_DEV"))
4545

4646
return HttpResponseForbidden()

src/django_forbid/skills/forbid_network.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def erase_response_attributes():
4242

4343
if geoip2_tz != "N/A" and client_tz != geoip2_tz:
4444
erase_response_attributes()
45-
# Redirects to the FORBIDDEN_VPN URL if set.
46-
if Settings.has("OPTIONS.URL.FORBIDDEN_VPN"):
47-
return redirect(Settings.get("OPTIONS.URL.FORBIDDEN_VPN"))
45+
# Redirects to the FORBIDDEN_NET URL if set.
46+
if Settings.has("OPTIONS.URL.FORBIDDEN_NET"):
47+
return redirect(Settings.get("OPTIONS.URL.FORBIDDEN_NET"))
4848
return HttpResponseForbidden()
4949

5050
# Restores the response from the session.

0 commit comments

Comments
 (0)