убрал проверку метода http запроса в media.get

This commit is contained in:
VladislavOstapov 2023-04-23 17:58:49 +03:00
parent 24fbf1287b
commit 451a8b9bc3

View File

@ -695,9 +695,6 @@ class ApiMedia:
value_min=0, value_max=1000000000), value_min=0, value_max=1000000000),
], returns="<code>медиа</code>, в противном случае ошибку") ], returns="<code>медиа</code>, в противном случае ошибку")
async def get(request, access_token, media_id): async def get(request, access_token, media_id):
if request.method != "GET":
return make_error_object(Exception(API_ERROR_INVALID_REQUEST, "method must be executed http GET method"))
m = await Media.objects.filter(Q(owner=access_token.user) | m = await Media.objects.filter(Q(owner=access_token.user) |
Q(owner__accountavatar__photo=media_id) | Q(owner__accountavatar__photo=media_id) |
Q(owner__accountavatar__profile_background_id=media_id)).filter(pk=media_id).afirst() Q(owner__accountavatar__profile_background_id=media_id)).filter(pk=media_id).afirst()