From 689dfcd83e308a1dbfeb52ea195c0d27872b2846 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 6 Dec 2012 23:04:29 -0600 Subject: [PATCH] fixed problem CRYPT password comparsion, issue 1203, thanks Alan --- VERSION | 2 +- gluon/validators.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 86c22746..5aee8290 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.3.0 (2012-12-06 23:01:24) rc1 +Version 2.3.0 (2012-12-06 23:03:48) rc1 diff --git a/gluon/validators.py b/gluon/validators.py index 9ab4c99d..6ec44656 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -2633,6 +2633,13 @@ class LazyCrypt(object): """ compares the current lazy crypted password with a stored password """ + + # LazyCrypt objects comparison + if isinstance(stored_password, self.__class__): + return ((self is stored_password) or + ((self.crypt.key == stored_password.crypt.key) and + (self.password == stored_password.password))) + if self.crypt.key: if ':' in self.crypt.key: key = self.crypt.key.split(':')[1]