mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Use ISO formatted dates when setting rolvaluntil. Fixes #1153
This commit is contained in:
committed by
Dave Page
parent
842d078142
commit
f3f7413701
@@ -145,7 +145,7 @@ class RoleView(PGChildNodeView):
|
|||||||
date = datetime.datetime.strptime(
|
date = datetime.datetime.strptime(
|
||||||
data[u'rolvaliduntil'], '%m/%d/%Y'
|
data[u'rolvaliduntil'], '%m/%d/%Y'
|
||||||
)
|
)
|
||||||
data[u'rolvaliduntil'] = date.strftime("%d-%B-%Y")
|
data[u'rolvaliduntil'] = date.strftime("%Y-%m-%d")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return precondition_required(
|
return precondition_required(
|
||||||
_("Date format is invalid.")
|
_("Date format is invalid.")
|
||||||
@@ -640,11 +640,8 @@ rolmembership:{
|
|||||||
'admin': True if role.group(1) == '1' else False
|
'admin': True if role.group(1) == '1' else False
|
||||||
})
|
})
|
||||||
row['rolmembership'] = res
|
row['rolmembership'] = res
|
||||||
row['rolvaliduntil'] = row['rolvaliduntil'].isoformat() \
|
if row['rolvaliduntil'] is not None:
|
||||||
if isinstance(
|
row['rolvaliduntil'] = row['rolvaliduntil'].split(' ')[0]
|
||||||
row['rolvaliduntil'],
|
|
||||||
(datetime.date, datetime.datetime)
|
|
||||||
) else None
|
|
||||||
if 'seclabels' in row and row['seclabels'] is not None:
|
if 'seclabels' in row and row['seclabels'] is not None:
|
||||||
res = []
|
res = []
|
||||||
for sec in row['seclabels']:
|
for sec in row['seclabels']:
|
||||||
|
|||||||
Reference in New Issue
Block a user