mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Using 'is_valid_ipaddress' utility function everywhere
This commit is contained in:
parent
d9c84edf9a
commit
3a4641889c
@ -523,13 +523,12 @@ class ServerNode(PGChildNodeView):
|
|||||||
data['db_res'] = ','.join(data['db_res'])
|
data['db_res'] = ','.join(data['db_res'])
|
||||||
|
|
||||||
if 'hostaddr' in data and data['hostaddr'] and data['hostaddr'] != '':
|
if 'hostaddr' in data and data['hostaddr'] and data['hostaddr'] != '':
|
||||||
if not self.pat4.match(data['hostaddr']):
|
if not is_valid_ipaddress(data['hostaddr']):
|
||||||
if not self.pat6.match(data['hostaddr']):
|
return make_json_response(
|
||||||
return make_json_response(
|
success=0,
|
||||||
success=0,
|
status=400,
|
||||||
status=400,
|
errormsg=gettext('Host address not valid')
|
||||||
errormsg=gettext('Host address not valid')
|
)
|
||||||
)
|
|
||||||
|
|
||||||
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
|
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
|
||||||
conn = manager.connection()
|
conn = manager.connection()
|
||||||
|
Loading…
Reference in New Issue
Block a user