Fixed an issue where MSQL is not loading while creating a new login role.

This commit is contained in:
Akshay Joshi 2023-04-03 14:50:45 +05:30
parent 287c53cd5a
commit 3eac4ba59e

View File

@ -529,20 +529,17 @@ rolmembership:{
data = json.loads(request.data) data = json.loads(request.data)
else: else:
data = dict() data = dict()
req = request.args or request.form for k, v in request.args.items():
try:
for key in req: # comments should be taken as is because if user enters
# a json comment it is parsed by loads which should not
val = req[key] # happen
if key in [ if k in ('comment',):
'rolcanlogin', 'rolsuper', 'rolcreatedb', data[k] = v
'rolcreaterole', 'rolinherit', 'rolreplication', else:
'rolcatupdate', 'variables', 'rolmembership', data[k] = json.loads(v)
'seclabels', 'rolmembers' except ValueError:
]: data[k] = v
data[key] = json.loads(val)
else:
data[key] = val
invalid_msg_arr = [ invalid_msg_arr = [
self._validate_rolname(kwargs.get('rid', -1), data), self._validate_rolname(kwargs.get('rid', -1), data),