Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Fix #129

Merged
merged 3 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ delay:
# proxy:
# protocol: https # NOTE: you can also set to 'http'
# ip: "1.1.1.1"
# port: '200'
# port: 200
2 changes: 1 addition & 1 deletion demo/settings_FR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ delay:
# proxy:
# protocol: https # NOTE: you can also set to 'http'
# ip: "1.1.1.1"
# port: '200'
# port: 200
2 changes: 1 addition & 1 deletion demo/settings_USA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ delay:
# proxy:
# protocol: https # NOTE: you can also set to 'http'
# ip: "1.1.1.1"
# port: '200'
# port: 200
5 changes: 3 additions & 2 deletions jobfunnel/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,17 @@ class JobFunnelSettingsValidator(Validator):
"""A simple JSON data validator with a custom data type for IPv4 addresses
https://codingnetworker.com/2016/03/validate-json-data-using-cerberus/
"""
def _validate_type_ipv4address(self, field, value):
def _validate_type_ipv4address(self, value):
"""
checks that the given value is a valid IPv4 address
"""
try:
# try to create an IPv4 address object using the python3 ipaddress
# module
ipaddress.IPv4Address(value)
return True
except:
self._error(field, "Not a valid IPv4 address")
self._error(value, "Not a valid IPv4 address")


SettingsValidator = JobFunnelSettingsValidator(SETTINGS_YAML_SCHEMA)