Skip to content

Commit

Permalink
Merge pull request #129 from thebigG/proxy_fix
Browse files Browse the repository at this point in the history
Proxy Fix
  • Loading branch information
thebigG authored Jan 6, 2021
2 parents ec63b0a + 8f019a5 commit c3d6d80
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 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_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)

0 comments on commit c3d6d80

Please sign in to comment.