Ensure port and username should not be mandatory when a service is provided. Fixes #4642

This commit is contained in:
Akshay Joshi
2019-09-13 11:54:16 +05:30
parent 9a69d27009
commit da553eec9b
5 changed files with 105 additions and 14 deletions

View File

@@ -723,9 +723,8 @@ class ServerNode(PGChildNodeView):
"""Add a server node to the settings database"""
required_args = [
u'name',
u'port',
u'db',
u'sslmode',
u'username'
]
data = request.form if request.form else json.loads(
@@ -741,7 +740,8 @@ class ServerNode(PGChildNodeView):
if 'service' in data and not data['service']:
required_args.extend([
u'host',
u'db',
u'port',
u'username',
u'role'
])
for arg in required_args: