From 6c214907a793706c2940929068ba13ccd21b6075 Mon Sep 17 00:00:00 2001 From: hadleyking Date: Thu, 30 Nov 2023 13:21:08 -0500 Subject: [PATCH 1/3] Added search to BCO admin page Changes to be committed: modified: api/admin.py --- api/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) From 919e29d94f3fd92d8db69ef0cafebef6e7eb9b81 Mon Sep 17 00:00:00 2001 From: hadleyking Date: Tue, 19 Dec 2023 10:46:52 -0500 Subject: [PATCH 2/3] update to test_db Changes to be committed: modified: tests/fixtures/test_data.json --- tests/fixtures/test_data.json | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) 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, From d5bc836ea413c4f927635b011ad476d12c0317aa Mon Sep 17 00:00:00 2001 From: hadleyking Date: Thu, 11 Jan 2024 09:28:26 -0500 Subject: [PATCH 3/3] Update permissions for bcodb search to AllowAny Changes to be committed: modified: search/apis.py --- search/apis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(