Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
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)
Exemple #4
0
 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
Exemple #5
0
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)