Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
孙永强 committed Nov 4, 2024
1 parent 5640e67 commit b0c085e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions seahub/api2/endpoints/user_avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions seahub/api2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b0c085e

Please sign in to comment.