From a85ee973ed90404180a0799d98ec05066950a7fd Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 26 Aug 2012 17:57:10 -0500 Subject: [PATCH] internal simplications in Auth --- VERSION | 2 +- gluon/tools.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index cce9f384..a3301346 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-26 17:53:23) dev +Version 2.00.0 (2012-08-26 17:57:07) dev diff --git a/gluon/tools.py b/gluon/tools.py index 96768dcb..9f0f32af 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -2197,7 +2197,7 @@ class Auth(object): key = getarg(-1) table_user = self.table_user() - user = self.db(table_user.registration_key == key).select().first() + user = table_user(registration_key=key) if not user: redirect(self.settings.login_url) if self.settings.registration_requires_approval: @@ -2272,7 +2272,7 @@ class Auth(object): if form.accepts(request, session, formname='retrieve_username', dbio=False, onvalidation=onvalidation,hideerror=self.settings.hideerror): - user = self.db(table_user.email == form.vars.email).select().first() + user = table_user(email=form.vars.email) if not user: current.session.flash = \ self.messages.invalid_email @@ -2350,7 +2350,7 @@ class Auth(object): if form.accepts(request, session, formname='retrieve_password', dbio=False, onvalidation=onvalidation,hideerror=self.settings.hideerror): - user = self.db(table_user.email == form.vars.email).select().first() + user = table_user(email=form.vars.email) if not user: current.session.flash = \ self.messages.invalid_email @@ -2490,7 +2490,7 @@ class Auth(object): formname='reset_password', dbio=False, onvalidation=onvalidation, hideerror=self.settings.hideerror): - user = self.db(table_user.email == form.vars.email).select().first() + user = table_user(email=form.vars.email) if not user: session.flash = self.messages.invalid_email redirect(self.url(args=request.args))