From ffa372d4160e119058402e43e39e75cc55272762 Mon Sep 17 00:00:00 2001 From: Paymir121 Date: Sun, 12 Nov 2023 22:24:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D0=BB=D1=83=D1=88=D0=BA?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/api/v1/views.py | 2 +- backend/request/documents.http | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/api/v1/views.py b/backend/api/v1/views.py index 7cbdafb..4fe8a2b 100644 --- a/backend/api/v1/views.py +++ b/backend/api/v1/views.py @@ -170,7 +170,7 @@ def get_queryset(self): return self.request.user.documents else: user = User.objects.get(id=1) - return Document.objects.get(owner=user) + return Document.objects.filter(owner=user) return Document.objects.none() def get_serializer_class(self): diff --git a/backend/request/documents.http b/backend/request/documents.http index 265bb6d..a40b568 100644 --- a/backend/request/documents.http +++ b/backend/request/documents.http @@ -1,10 +1,9 @@ @TOKEN = Token bb4f5dbedaafd2730f35803e7087e797479d68f5 -# @URL = https://documents-template.site/ -@URL = http://127.0.0.1:8000 +@URL = https://documents-template.site/ +# @URL = http://127.0.0.1:8000 ### -GET {{URL}}/api/documents/32/ -Content-Type: application/json +GET {{URL}}/api/documents/1 # Authorization: {{TOKEN}} {