aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-12-28 17:38:59 +0800
committerGitHub <noreply@github.com>2023-12-28 09:38:59 +0000
commitf3999888c0b765380003f814f9c3d5cf80128167 (patch)
tree757e14c4cff65a4f123c248ceda20960ee8144ca /routers
parent921df1cbad83dcba37ff12cba88c7d3a69f8588b (diff)
downloadgitea-f3999888c0b765380003f814f9c3d5cf80128167.tar.gz
gitea-f3999888c0b765380003f814f9c3d5cf80128167.zip
Refactor some legacy code and remove unused code (#28622)
1. use slices.Contains, remove Int64sContains 2. use HashEmail, remove base.EncodeMD5 3. remove BasicAuthEncode, IsLetter
Diffstat (limited to 'routers')
-rw-r--r--routers/web/user/setting/profile.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/web/user/setting/profile.go b/routers/web/user/setting/profile.go
index d8331fef43..00614565d2 100644
--- a/routers/web/user/setting/profile.go
+++ b/routers/web/user/setting/profile.go
@@ -14,6 +14,7 @@ import (
"path/filepath"
"strings"
+ "code.gitea.io/gitea/models/avatars"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/organization"
repo_model "code.gitea.io/gitea/models/repo"
@@ -130,7 +131,7 @@ func UpdateAvatarSetting(ctx *context.Context, form *forms.AvatarForm, ctxUser *
ctxUser.UseCustomAvatar = form.Source == forms.AvatarLocal
if len(form.Gravatar) > 0 {
if form.Avatar != nil {
- ctxUser.Avatar = base.EncodeMD5(form.Gravatar)
+ ctxUser.Avatar = avatars.HashEmail(form.Gravatar)
} else {
ctxUser.Avatar = ""
}