From 01801e4acb20e97a2cb06bd9c99810ea7605d12e Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Mon, 20 Jun 2016 10:11:42 +0100 Subject: [PATCH] Fix date validation while creating new role. Fixes #1370 --- web/pgadmin/browser/server_groups/servers/roles/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/browser/server_groups/servers/roles/__init__.py b/web/pgadmin/browser/server_groups/servers/roles/__init__.py index eda02c4f7..7631b65c1 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/roles/__init__.py @@ -137,7 +137,9 @@ class RoleView(PGChildNodeView): # Make date explicit so that it works with every # postgres database datestyle format try: - if data[u'rolvaliduntil'] is not None: + if data[u'rolvaliduntil'] is not None and \ + data[u'rolvaliduntil'] != '' and \ + len(data[u'rolvaliduntil']) > 0: date = datetime.datetime.strptime( data[u'rolvaliduntil'], '%m/%d/%Y' )