コード例 #1
0
ファイル: security.py プロジェクト: gmalik9/samplesdb
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
コード例 #2
0
ファイル: security.py プロジェクト: waveform80/samplesdb
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
コード例 #3
0
ファイル: security.py プロジェクト: gmalik9/samplesdb
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)
コード例 #4
0
ファイル: validators.py プロジェクト: waveform80/samplesdb
 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
コード例 #5
0
ファイル: security.py プロジェクト: waveform80/samplesdb
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)