Skip to content

Remove dead code for old pagination that is no longer supported #490

Description

@duckduckgrayduck

Since the default settings.DEFAULT_REST_FRAMEWORK is now 2.0 and it has been on production for quite a long time, we should probably just clean up the versioning and the old pagination since it is unlikely to ever be used again.

  • From config/settings/base.py

remove "DEFAULT_VERSION": env("REST_FRAMEWORK_DEFAULT_VERSION", default="2.0") & "ALLOWED_VERSIONS": ["1.0", "2.0"],
Change "DEFAULT_PAGINATION_CLASS": "documentcloud.core.pagination.VersionedPagination", to CursorPagination from the same file
Remove:
AUTH_PAGE_LIMIT = env.int("AUTH_PAGE_LIMIT", default=1000)
ANON_PAGE_LIMIT = env.int("ANON_PAGE_LIMIT", default=100)

Remove "DEFAULT_VERSIONING_CLASS": "documentcloud.core.versioning.QueryParameterVersioning",

  • From DocumentCloud/core/pagination.py remove probably everything aside from CursorPagination
    -For anon probably re-introduce a smaller page size cap
  • Delete documentcloud/core/versioning.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions