From f7727c77d6f13954e49612bf1aebd80ede441d35 Mon Sep 17 00:00:00 2001 From: Mikko Nieminen Date: Fri, 3 Jan 2025 15:46:44 +0100 Subject: [PATCH] add SODAR_API_PAGE_SIZE to siteinfo (#1530) --- config/settings/base.py | 19 +++++++++++++------ siteinfo/views.py | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 7326a1fc..1708ecc9 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -318,9 +318,21 @@ CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = False +# API Settings +# ------------------------------------------------------------------------------ + +# SODAR API host URL +SODAR_API_DEFAULT_HOST = env.url( + 'SODAR_API_DEFAULT_HOST', 'http://0.0.0.0:8000' +) +# SODAR API pagination page size +SODAR_API_PAGE_SIZE = env.int('SODAR_API_PAGE_SIZE', 100) + + # Django REST framework # ------------------------------------------------------------------------------ + REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.BasicAuthentication', @@ -330,7 +342,7 @@ 'DEFAULT_PAGINATION_CLASS': ( 'rest_framework.pagination.PageNumberPagination' ), - 'PAGE_SIZE': env.int('SODAR_API_PAGE_SIZE', 100), + 'PAGE_SIZE': SODAR_API_PAGE_SIZE, } # Additional authentication settings @@ -557,11 +569,6 @@ def set_logging(level=None): ], ) -# SODAR API host URL -SODAR_API_DEFAULT_HOST = env.url( - 'SODAR_API_DEFAULT_HOST', 'http://0.0.0.0:8000' -) - # Projectroles app settings diff --git a/siteinfo/views.py b/siteinfo/views.py index 41c63944..132a92ee 100644 --- a/siteinfo/views.py +++ b/siteinfo/views.py @@ -89,6 +89,7 @@ 'SOCIAL_AUTH_OIDC_KEY', 'SOCIAL_AUTH_OIDC_USERNAME_KEY', 'SODAR_API_DEFAULT_HOST', + 'SODAR_API_PAGE_SIZE', 'STATICFILES_DIRS', 'STATICFILES_FINDERS', 'TEMPLATES',