From acab0ad2315bfca2caf9848f6ca3f6462f994b66 Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Wed, 21 Jan 2015 01:39:07 +0100 Subject: [PATCH] auth.settings.*_case_sensitivity support for password retrieval --- gluon/tools.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gluon/tools.py b/gluon/tools.py index 2067e877..33267b83 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -3097,10 +3097,15 @@ class Auth(object): IS_EMAIL(error_message=self.messages.invalid_email), IS_IN_DB(self.db, table_user.email, error_message=self.messages.invalid_email)] + if not self.settings.email_case_sensitive: + table_user.email.requires.insert(0, IS_LOWER()) else: table_user.username.requires = [ IS_IN_DB(self.db, table_user.username, error_message=self.messages.invalid_username)] + if not self.settings.username_case_sensitive: + table_user.username.requires.insert(0, IS_LOWER()) + form = SQLFORM(table_user, fields=[userfield], hidden=dict(_next=next),