summaryrefslogtreecommitdiffstats
path: root/routers/repo/setting.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-10-14 21:07:51 +0800
committerGitHub <noreply@github.com>2020-10-14 21:07:51 +0800
commit80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc (patch)
tree504c7ccdc9cb42e0e282abdd8dbb75c4b24e9f5b /routers/repo/setting.go
parent93f7525061bc9e6f5be734aba0de31b64c63d7a8 (diff)
downloadgitea-80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc.tar.gz
gitea-80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc.zip
Avatars and Repo avatars support storing in minio (#12516)
* Avatar support minio * Support repo avatar minio storage * Add missing migration * Fix bug * Fix test * Add test for minio store type on avatars and repo avatars; Add documents * Fix bug * Fix bug * Add back missed avatar link method * refactor codes * Simplify the codes * Code improvements * Fix lint * Fix test mysql * Fix test mysql * Fix test mysql * Fix settings * Fix test * fix test * Fix bug
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r--routers/repo/setting.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 1b75522958..e4f8adc38f 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -30,7 +30,6 @@ import (
mirror_service "code.gitea.io/gitea/services/mirror"
repo_service "code.gitea.io/gitea/services/repository"
- "github.com/unknwon/com"
"mvdan.cc/xurls/v2"
)
@@ -928,7 +927,7 @@ func UpdateAvatarSetting(ctx *context.Context, form auth.AvatarForm) error {
// No avatar is uploaded and we not removing it here.
// No random avatar generated here.
// Just exit, no action.
- if !com.IsFile(ctxRepo.CustomAvatarPath()) {
+ if ctxRepo.CustomAvatarRelativePath() == "" {
log.Trace("No avatar was uploaded for repo: %d. Default icon will appear instead.", ctxRepo.ID)
}
return nil
@@ -940,7 +939,7 @@ func UpdateAvatarSetting(ctx *context.Context, form auth.AvatarForm) error {
}
defer r.Close()
- if form.Avatar.Size > setting.AvatarMaxFileSize {
+ if form.Avatar.Size > setting.Avatar.MaxFileSize {
return errors.New(ctx.Tr("settings.uploaded_avatar_is_too_big"))
}