From b0c085e5b907b2d30c3178bac8c3da33b1d8ecd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B0=B8=E5=BC=BA?= <11704063+s-yongqiang@user.noreply.gitee.com> Date: Mon, 4 Nov 2024 14:21:00 +0800 Subject: [PATCH] test --- seahub/api2/endpoints/user_avatar.py | 1 + seahub/api2/views.py | 1 + 2 files changed, 2 insertions(+) diff --git a/seahub/api2/endpoints/user_avatar.py b/seahub/api2/endpoints/user_avatar.py index b4c4ac5260..da6f94a2a2 100644 --- a/seahub/api2/endpoints/user_avatar.py +++ b/seahub/api2/endpoints/user_avatar.py @@ -46,6 +46,7 @@ def post(self, request): return api_error(status.HTTP_400_BAD_REQUEST, error_msg) username = request.user.username + print(username, '----username') count = Avatar.objects.filter(emailuser=username).count() if AVATAR_MAX_AVATARS_PER_USER > 1 and count >= AVATAR_MAX_AVATARS_PER_USER: error_msg = _("You already have %(nb_avatars)d avatars, and the maximum allowed is %(nb_max_avatars)d.") % { 'nb_avatars' : count, 'nb_max_avatars' : AVATAR_MAX_AVATARS_PER_USER} diff --git a/seahub/api2/views.py b/seahub/api2/views.py index 8fb54b6aff..ce27e429fe 100644 --- a/seahub/api2/views.py +++ b/seahub/api2/views.py @@ -5059,6 +5059,7 @@ class UserAvatarView(APIView): throttle_classes = (UserRateThrottle, ) def get(self, request, user, size, format=None): + print(user, '---user') url, is_default, date_uploaded = api_avatar_url(user, int(size)) ret = { "url": url,