Fixed invalid literal issue when removing the connection limit for the existing role. Fixes #5001

This commit is contained in:
Akshay Joshi
2020-05-07 13:14:45 +05:30
parent a662d866af
commit 6ad46e1860
2 changed files with 5 additions and 0 deletions

View File

@@ -158,6 +158,10 @@ class RoleView(PGChildNodeView):
)
if u'rolconnlimit' in data:
# If roleconnlimit is empty string then set it to -1
if data[u'rolconnlimit'] == '':
data[u'rolconnlimit'] = -1
if data[u'rolconnlimit'] is not None:
data[u'rolconnlimit'] = int(data[u'rolconnlimit'])
if type(data[u'rolconnlimit']) != int or \