mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-10 21:56:34 +03:00
bug fixes
This commit is contained in:
parent
e9dcccbced
commit
709bda158a
|
@ -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:
|
||||
...
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user