Skip to content

Commit

Permalink
-Fixed proxy settings issues. Fixes PaulMcInnis#124
Browse files Browse the repository at this point in the history
  • Loading branch information
thebigG committed Nov 26, 2020
1 parent cf80740 commit 2417f6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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_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)

0 comments on commit 2417f6e

Please sign in to comment.