Skip to content

Commit b2a7b45

Browse files
committed
Merge branch 'dev' into feature/chats
2 parents 01ec775 + ed8d0e1 commit b2a7b45

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

files/views.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ def delete(self, request, *args, **kwargs):
3030
"""deletes the file (only if the request is sent by the user who owns it!)
3131
The link has to be specified in the JSON body, not in the URL arguments.
3232
"""
33-
if request.data and (request.data.get("link") is not None):
34-
link = request.data.get("link")
33+
# get the link from the query
34+
if request.query_params and (request.query_params.get("link") is not None):
35+
link = request.query_params.get("link")
3536
else:
3637
return Response(
3738
{
38-
"error": "you have to pass the link of the object you want to delete as JSON"
39+
"error": "you have to pass the link of the object you want to delete in query parameters"
3940
},
4041
status=status.HTTP_400_BAD_REQUEST,
4142
)

users/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ class LogoutView(APIView):
337337

338338
def post(self, request):
339339
try:
340-
# get request's refresh token from headers
341-
refresh_token = request.headers["Authorization"].split(" ")[1]
340+
# get refresh token from request body
341+
refresh_token = request.data["refresh_token"]
342342
# blacklist the refresh token
343343
RefreshToken(refresh_token).blacklist()
344344
return Response(status=status.HTTP_205_RESET_CONTENT)

0 commit comments

Comments
 (0)