bug fixes

This commit is contained in:
Alexander Karpov 2024-04-07 23:05:25 +03:00
parent e9dcccbced
commit 709bda158a

View File

@ -400,9 +400,10 @@ def post(self, request, *args, **kwargs):
try:
user_id = self.request.data.get("user_id", None)
user = User.objects.get(id=user_id)
if user != self.request.user:
return Response(status=403)
if user_id:
user = User.objects.cache().get(id=user_id)
if user != self.request.user:
return Response(status=403)
except User.DoesNotExist:
...