Need to unwrap the flask user to get the db user for api queries.
This commit is contained in:
parent
cc58b970d6
commit
2611d70185
2 changed files with 4 additions and 4 deletions
2
api.py
2
api.py
|
@ -35,7 +35,7 @@ def list_repos_api():
|
|||
}
|
||||
|
||||
repos = [repo_view(repo)
|
||||
for repo in model.get_user_repositories(current_user)]
|
||||
for repo in model.get_user_repositories(current_user.db_user)]
|
||||
response = {
|
||||
'repositories': repos
|
||||
}
|
||||
|
|
6
app.py
6
app.py
|
@ -21,13 +21,13 @@ login_manager.login_view = 'signin'
|
|||
|
||||
class _LoginWrappedDBUser(UserMixin):
|
||||
def __init__(self, db_user):
|
||||
self._db_user = db_user
|
||||
self.db_user = db_user
|
||||
|
||||
def is_active(self):
|
||||
return self._db_user.verified
|
||||
return self.db_user.verified
|
||||
|
||||
def get_id(self):
|
||||
return unicode(self._db_user.username)
|
||||
return unicode(self.db_user.username)
|
||||
|
||||
|
||||
@login_manager.user_loader
|
||||
|
|
Reference in a new issue