public inbox for [email protected]
help / color / mirror / Atom feedFrom: Murtuza Zabuawala <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: PATCH: To convert role expiry date format to ISO8601 (pgAdmin4)
Date: Wed, 31 Aug 2016 19:04:52 +0530
Message-ID: <CAKKotZStuWFYNELeOtpgy=ZvYo1vKHX8+nudhKu3xmK9NAtqdw@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi,
PFA minor patch to fix the issue of converting role expiry date format to
ISO8601
RM#1153
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[application/octet-stream] RM_1153.patch (1.4K, 3-RM_1153.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/roles/__init__.py b/web/pgadmin/browser/server_groups/servers/roles/__init__.py
index bee3d02..dbf0d71 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/roles/__init__.py
@@ -145,7 +145,7 @@ class RoleView(PGChildNodeView):
date = datetime.datetime.strptime(
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:
return precondition_required(
_("Date format is invalid.")
@@ -640,11 +640,8 @@ rolmembership:{
'admin': True if role.group(1) == '1' else False
})
row['rolmembership'] = res
- row['rolvaliduntil'] = row['rolvaliduntil'].isoformat() \
- if isinstance(
- row['rolvaliduntil'],
- (datetime.date, datetime.datetime)
- ) else None
+ if row['rolvaliduntil'] is not None:
+ row['rolvaliduntil'] = row['rolvaliduntil'].split(' ')[0]
if 'seclabels' in row and row['seclabels'] is not None:
res = []
for sec in row['seclabels']:
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: PATCH: To convert role expiry date format to ISO8601 (pgAdmin4)
In-Reply-To: <CAKKotZStuWFYNELeOtpgy=ZvYo1vKHX8+nudhKu3xmK9NAtqdw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox