0.12.17 change_avatar_confirm_ajax RequestDataTooBig

This commit is contained in:
SDE
2024-02-05 23:02:11 +03:00
parent f86be5bd97
commit 1479584bfc
3 changed files with 5 additions and 4 deletions

View File

@@ -265,12 +265,12 @@ def change_avatar_confirm_ajax(request):
except RequestDataTooBig:
msg = _('Слишком большой размер файла. Размер файла не должен быть больше 3МБ')
print(msg)
JsonResponse({'error': msg}, status=400)
return JsonResponse({'error': msg}, status=400)
except Exception as e:
msg = f'change_avatar_confirm_ajax Error = {str(e)}'
print(msg)
JsonResponse({'error': msg}, status=400)
return JsonResponse({'error': msg}, status=400)
return JsonResponse({'url': request.user.user_profile.avatar.url})