def authenticate(email_address, password): "Authenticates the user with the specified email address and password" # Need a transaction as User.authenticate can potentially write to the # database in the event of hash transitions with transaction.manager: user = User.by_email(email_address) if user is not None: return user.authenticate(password) else: return False
def authenticate(email_address, password): "Authenticates the user with the specified email address and password" # Need a transaction as User.authenticate can potentially write to the # database in the event of hash transitions with transaction.manager: user = User.by_email(email_address) if user is not None: return user.authenticate(password) else: return False
def get_user(request): "Returns the User object based on a request's unauth'ed user" email_address = unauthenticated_userid(request) if email_address is not None: return User.by_email(email_address)
def _to_python(self, value, state): result = User.by_email(value) if result is None: raise Invalid('No users have address %s' % value, value, state) return result
def get_user(request): "Returns the User object based on a request's unauth'ed user" email_address = unauthenticated_userid(request) if email_address is not None: return User.by_email(email_address)