v2: mv _paginate paginate
This commit is contained in:
parent
e6c99bb471
commit
21cbe0bd07
3 changed files with 6 additions and 6 deletions
|
@ -31,8 +31,8 @@ time_blueprint(v2_bp, metric_queue)
|
|||
_MAX_RESULTS_PER_PAGE = 50
|
||||
|
||||
|
||||
def _paginate(limit_kwarg_name='limit', offset_kwarg_name='offset',
|
||||
callback_kwarg_name='pagination_callback'):
|
||||
def paginate(limit_kwarg_name='limit', offset_kwarg_name='offset',
|
||||
callback_kwarg_name='pagination_callback'):
|
||||
def wrapper(func):
|
||||
@wraps(func)
|
||||
def wrapped(*args, **kwargs):
|
||||
|
|
|
@ -2,12 +2,12 @@ from flask import jsonify
|
|||
|
||||
from auth.registry_jwt_auth import process_registry_jwt_auth, get_granted_entity
|
||||
from endpoints.decorators import anon_protect
|
||||
from endpoints.v2 import v2_bp, _paginate
|
||||
from endpoints.v2 import v2_bp, paginate
|
||||
|
||||
@v2_bp.route('/_catalog', methods=['GET'])
|
||||
@process_registry_jwt_auth()
|
||||
@anon_protect
|
||||
@_paginate()
|
||||
@paginate()
|
||||
def catalog_search(limit, offset, pagination_callback):
|
||||
username = None
|
||||
entity = get_granted_entity()
|
||||
|
|
|
@ -2,7 +2,7 @@ from flask import jsonify
|
|||
|
||||
from auth.registry_jwt_auth import process_registry_jwt_auth
|
||||
from endpoints.common import parse_repository_name
|
||||
from endpoints.v2 import v2_bp, require_repo_read, _paginate
|
||||
from endpoints.v2 import v2_bp, require_repo_read, paginate
|
||||
from endpoints.v2.errors import NameUnknown
|
||||
from endpoints.decorators import anon_protect
|
||||
|
||||
|
@ -11,7 +11,7 @@ from endpoints.decorators import anon_protect
|
|||
@process_registry_jwt_auth(scopes=['pull'])
|
||||
@require_repo_read
|
||||
@anon_protect
|
||||
@_paginate()
|
||||
@paginate()
|
||||
def list_all_tags(namespace_name, repo_name, limit, offset, pagination_callback):
|
||||
repo = v2.get_repository(namespace_name, repo_name)
|
||||
if repo is None:
|
||||
|
|
Reference in a new issue