diff --git a/api/admin.py b/api/admin.py index 0ddab262..98a2e528 100755 --- a/api/admin.py +++ b/api/admin.py @@ -10,7 +10,10 @@ from api.model.prefix import Prefix, prefix_table from api.model.groups import GroupInfo -admin.site.register(BCO, GuardedModelAdmin) +class BcoModelAdmin(admin.ModelAdmin): + search_fields = ["contents", "object_id"] +admin.site.register(BCO, BcoModelAdmin) +# admin.site.register( admin.site.register(prefix_table) admin.site.register(new_users) admin.site.register(GroupInfo) diff --git a/search/apis.py b/search/apis.py index f6195cd2..c1beca12 100644 --- a/search/apis.py +++ b/search/apis.py @@ -3,7 +3,7 @@ from drf_yasg import openapi from drf_yasg.utils import swagger_auto_schema from rest_framework import status -from rest_framework.permissions import IsAuthenticated +from rest_framework.permissions import AllowAny from rest_framework.response import Response from rest_framework.views import APIView from search.selectors import search_db, controled_list @@ -28,7 +28,7 @@ class SearchObjectsAPI(APIView): ``` """ - permission_classes = [IsAuthenticated] + permission_classes = [AllowAny] auth = openapi.Parameter('test', openapi.IN_QUERY, description="test manual param", type=openapi.TYPE_BOOLEAN) @swagger_auto_schema( diff --git a/tests/fixtures/test_data.json b/tests/fixtures/test_data.json index 84793f12..eeb429b7 100644 --- a/tests/fixtures/test_data.json +++ b/tests/fixtures/test_data.json @@ -994,6 +994,70 @@ "codename": "view_authentication" } }, + { + "model": "authtoken.token", + "pk": "07801a1a4cdbf1945e22ac8439f1db27fe813f7a", + "fields": { + "user": 6, + "created": "2022-05-10T20:35:53.548Z" + } + }, + { + "model": "authtoken.token", + "pk": "0bd55c955fcbfc269f6dc8f61ea107674cafdecb", + "fields": { + "user": 8, + "created": "2022-05-10T20:53:42.503Z" + } + }, + { + "model": "authtoken.token", + "pk": "166c6a8f7e6e34827f4231a37c73f4ff985b43a2", + "fields": { + "user": 5, + "created": "2022-05-10T20:35:14.846Z" + } + }, + { + "model": "authtoken.token", + "pk": "2f2a599026581c158a07f968c56292c77f4be875", + "fields": { + "user": 2, + "created": "2022-05-10T20:35:14.509Z" + } + }, + { + "model": "authtoken.token", + "pk": "3f5504d88a5085d0452b19350fb6f82ae7097dd0", + "fields": { + "user": 9, + "created": "2022-05-10T20:54:44.797Z" + } + }, + { + "model": "authtoken.token", + "pk": "627626823549f787c3ec763ff687169206626149", + "fields": { + "user": 3, + "created": "2022-05-10T20:35:14.520Z" + } + }, + { + "model": "authtoken.token", + "pk": "8d66642cb77c4cb55af75d0f6c4f2835f805dcaa", + "fields": { + "user": 4, + "created": "2022-05-10T20:35:14.695Z" + } + }, + { + "model": "authtoken.token", + "pk": "c400a6076a2dfe7e9906ab86c6ad4574d1d60e03", + "fields": { + "user": 7, + "created": "2022-05-10T20:50:39.096Z" + } + }, { "model": "auth.group", "pk": 1,