Merge "Remove page_size_maximum"

This commit is contained in:
Jenkins 2015-04-09 08:27:53 +00:00 committed by Gerrit Code Review
commit 628e7a1e5b
15 changed files with 15 additions and 20 deletions

View File

@ -38,7 +38,6 @@ lock_path = $state_path/lock
# bind_port = 8080
# List paging configuration options.
# page_size_maximum = 500
# page_size_default = 20
# Enable notifications. This feature drives deferred processing, reporting,

View File

@ -22,10 +22,6 @@ app = {
}
cfg.CONF.register_opts([
cfg.IntOpt('page_size_maximum',
default=500,
help='The maximum number of results to allow a user to request '
'from the API'),
cfg.IntOpt('page_size_default',
default=20,
help='The maximum number of results to allow a user to request '

View File

@ -82,7 +82,7 @@ class BranchesController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_branch = branches_api.branch_get(marker)

View File

@ -81,7 +81,7 @@ class MilestonesController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_milestone = milestones_api.milestone_get(marker)

View File

@ -131,7 +131,7 @@ class ProjectGroupsController(rest.RestController):
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_group = project_groups.project_group_get(marker)

View File

@ -100,7 +100,7 @@ class ProjectsController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_project = projects_api.project_get(marker)

View File

@ -94,7 +94,7 @@ class StoriesController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_story = stories_api.story_get(marker)

View File

@ -108,7 +108,7 @@ class SubscriptionEventsController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_sub = subscription_events_api.subscription_events_get(marker)

View File

@ -101,7 +101,7 @@ class SubscriptionsController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Sanity check on user_id
current_user = user_api.user_get(request.current_user_id)

View File

@ -39,7 +39,7 @@ class TaskStatusesController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
statuses = tasks_api.task_get_statuses()
task_statuses = []

View File

@ -295,7 +295,7 @@ class TasksPrimaryController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_task = tasks_api.task_get(marker)
@ -470,7 +470,7 @@ class TasksNestedController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_task = tasks_api.task_get(marker)

View File

@ -136,7 +136,7 @@ class TeamsController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_team = teams_api.team_get(marker)

View File

@ -81,7 +81,7 @@ class TimeLineEventsController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Sanity check on event types.
if event_type:
@ -155,7 +155,7 @@ class CommentsController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_event = None

View File

@ -74,7 +74,7 @@ class UserTokensController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_token = token_api.user_token_get(marker)

View File

@ -74,7 +74,7 @@ class UsersController(rest.RestController):
# Boundary check on limit.
if limit is None:
limit = CONF.page_size_default
limit = min(CONF.page_size_maximum, max(1, limit))
limit = max(0, limit)
# Resolve the marker record.
marker_user = users_api.user_get(marker)