def get_auth_token(self): return util.encrypt(self.email)
def authenticate(self, password): if not util.encrypt(password, self.password) == self.password: raise exception.Unauthorized('%s password mismatch' % self.email)