From 002cb059826241cc626e7cb78ce06bc7712b4704 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sat, 27 Jan 2024 21:28:36 -0800 Subject: [PATCH] Small fixup to make it run. --- etebase_server/fastapi/dependencies.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etebase_server/fastapi/dependencies.py b/etebase_server/fastapi/dependencies.py index a54ac97..8c3908e 100644 --- a/etebase_server/fastapi/dependencies.py +++ b/etebase_server/fastapi/dependencies.py @@ -11,7 +11,6 @@ from etebase_server.myauth.models import UserType, get_typed_user_model from .db_hack import django_db_cleanup_decorator from .exceptions import AuthenticationFailed -from .utils import get_object_or_404 User = get_typed_user_model() token_scheme = APIKeyHeader(name="Authorization") @@ -75,6 +74,8 @@ def get_collection_queryset(user: UserType = Depends(get_authenticated_user)) -> @django_db_cleanup_decorator def get_collection(collection_uid: str, queryset: QuerySet = Depends(get_collection_queryset)) -> models.Collection: + from .utils import get_object_or_404 + return get_object_or_404(queryset, uid=collection_uid)