Convert a current_user to get_authenticated_user in the repository api.
This commit is contained in:
parent
092e236694
commit
67353de179
1 changed files with 3 additions and 4 deletions
|
@ -3,7 +3,6 @@ import json
|
||||||
|
|
||||||
from flask import current_app, request
|
from flask import current_app, request
|
||||||
from flask.ext.restful import reqparse, abort
|
from flask.ext.restful import reqparse, abort
|
||||||
from flask.ext.login import current_user
|
|
||||||
|
|
||||||
from data import model
|
from data import model
|
||||||
from endpoints.api import (truthy_bool, format_date, nickname, log_action, validate_json_request,
|
from endpoints.api import (truthy_bool, format_date, nickname, log_action, validate_json_request,
|
||||||
|
@ -13,8 +12,8 @@ from endpoints.api import (truthy_bool, format_date, nickname, log_action, valid
|
||||||
from auth.permissions import (ReadRepositoryPermission, ModifyRepositoryPermission,
|
from auth.permissions import (ReadRepositoryPermission, ModifyRepositoryPermission,
|
||||||
AdministerRepositoryPermission, CreateRepositoryPermission)
|
AdministerRepositoryPermission, CreateRepositoryPermission)
|
||||||
from auth.auth import process_auth
|
from auth.auth import process_auth
|
||||||
from auth import scopes
|
|
||||||
from auth.auth_context import get_authenticated_user
|
from auth.auth_context import get_authenticated_user
|
||||||
|
from auth import scopes
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -113,8 +112,8 @@ class RepositoryList(ApiResource):
|
||||||
}
|
}
|
||||||
|
|
||||||
username = None
|
username = None
|
||||||
if current_user.is_authenticated() and args['private']:
|
if get_authenticated_user() and args['private']:
|
||||||
username = current_user.db_user().username
|
username = get_authenticated_user().username
|
||||||
|
|
||||||
response = {}
|
response = {}
|
||||||
|
|
||||||
|
|
Reference in a new issue