diff --git a/app/apps/events/mixins.py b/app/apps/events/mixins.py index 1dd36b25a..faa1d02c6 100644 --- a/app/apps/events/mixins.py +++ b/app/apps/events/mixins.py @@ -14,10 +14,6 @@ class CaseEventsMixin: def events(self, request, pk): try: case = Case.objects.get(pk=pk) - # if case.sensitive and not request.user.has_perm( - # "users.access_sensitive_dossiers" - # ): - # return Response(status=status.HTTP_403_FORBIDDEN) except Case.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) diff --git a/app/config/settings.py b/app/config/settings.py index e6f7190d5..8f40525a7 100644 --- a/app/config/settings.py +++ b/app/config/settings.py @@ -104,22 +104,7 @@ "OPTIONS": {"sslmode": "allow", "connect_timeout": 5}, }, } -REST_FRAMEWORK = { - "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", - "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", - "PAGE_SIZE": 500, - "DATETIME_FORMAT": "%Y-%m-%dT%H:%M:%S%z", - "DEFAULT_RENDERER_CLASSES": ( - "rest_framework.renderers.JSONRenderer", - "rest_framework.renderers.BrowsableAPIRenderer", - ), - "DEFAULT_PERMISSION_CLASSES": ("apps.users.permissions.IsInAuthorizedRealm",), - "DEFAULT_AUTHENTICATION_CLASSES": ( - "apps.users.auth.AuthenticationClass", - "rest_framework.authentication.TokenAuthentication", - ), - "EXCEPTION_HANDLER": "utils.exceptions.custom_exception_handler", -} + MIDDLEWARE = ( "opencensus.ext.django.middleware.OpencensusMiddleware", "corsheaders.middleware.CorsMiddleware", @@ -166,6 +151,22 @@ }, ] +REST_FRAMEWORK = { + "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", + "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", + "PAGE_SIZE": 500, + "DATETIME_FORMAT": "%Y-%m-%dT%H:%M:%S%z", + "DEFAULT_RENDERER_CLASSES": ( + "rest_framework.renderers.JSONRenderer", + "rest_framework.renderers.BrowsableAPIRenderer", + ), + "DEFAULT_PERMISSION_CLASSES": ("apps.users.permissions.IsInAuthorizedRealm",), + "DEFAULT_AUTHENTICATION_CLASSES": ( + "apps.users.auth.AuthenticationClass", + "rest_framework.authentication.TokenAuthentication", + ), + "EXCEPTION_HANDLER": "utils.exceptions.custom_exception_handler", +} SPECTACULAR_SETTINGS = { "SCHEMA_PATH_PREFIX": "/api/v[0-9]/",