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,