summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorMorgan Bazalgette <git@howl.moe>2018-02-03 23:37:05 +0100
committerLauris BH <lauris@nix.lv>2018-02-04 00:37:05 +0200
commit17655cdf1b409521262d5d54eb19884d307c47ce (patch)
treeb06d15367afc6bd4f915c0e8b9272241bb3f4a3c /models/user.go
parent77f8bad2fb7a6a4ab57b398cb89e6889f76ffe8a (diff)
downloadgitea-17655cdf1b409521262d5d54eb19884d307c47ce.tar.gz
gitea-17655cdf1b409521262d5d54eb19884d307c47ce.zip
Enable caching on assets and avatars (#3376)
* Enable caching on assets and avatars Fixes #3323 * Only set avatar in user BeforeUpdate when there is no avatar set * add error checking after stat * gofmt * Change cache time for avatars to an hour
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index bf28683285..ecfe3bca0f 100644
--- a/models/user.go
+++ b/models/user.go
@@ -145,7 +145,7 @@ func (u *User) BeforeUpdate() {
if len(u.AvatarEmail) == 0 {
u.AvatarEmail = u.Email
}
- if len(u.AvatarEmail) > 0 {
+ if len(u.AvatarEmail) > 0 && u.Avatar == "" {
u.Avatar = base.HashEmail(u.AvatarEmail)
}
}