From cfff6ad93e5de585d3a10be37ffe69daba526f88 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 2 Apr 2024 11:55:00 +1100 Subject: [PATCH] Settings fix (#6904) * Fix JWT configuration - Bug fix for statement which had no effect * Replace tuple with list --- InvenTree/InvenTree/settings.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 539aa4f9a1..012394b212 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -426,17 +426,17 @@ TEMPLATES = [ REST_FRAMEWORK = { 'EXCEPTION_HANDLER': 'InvenTree.exceptions.exception_handler', 'DATETIME_FORMAT': '%Y-%m-%d %H:%M', - 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'DEFAULT_AUTHENTICATION_CLASSES': [ 'users.authentication.ApiTokenAuthentication', 'rest_framework.authentication.BasicAuthentication', 'rest_framework.authentication.SessionAuthentication', - ), + ], 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', - 'DEFAULT_PERMISSION_CLASSES': ( + 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated', 'rest_framework.permissions.DjangoModelPermissions', 'InvenTree.permissions.RolePermission', - ), + ], 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', 'DEFAULT_METADATA_CLASS': 'InvenTree.metadata.InvenTreeMetadata', 'DEFAULT_RENDERER_CLASSES': ['rest_framework.renderers.JSONRenderer'], @@ -462,8 +462,8 @@ REST_AUTH_REGISTER_SERIALIZERS = { if USE_JWT: JWT_AUTH_COOKIE = 'inventree-auth' JWT_AUTH_REFRESH_COOKIE = 'inventree-token' - REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] + ( - 'dj_rest_auth.jwt_auth.JWTCookieAuthentication', + REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'].append( + 'dj_rest_auth.jwt_auth.JWTCookieAuthentication' ) INSTALLED_APPS.append('rest_framework_simplejwt')