diff options
Diffstat (limited to 'models/avatars')
-rw-r--r-- | models/avatars/avatar.go | 4 | ||||
-rw-r--r-- | models/avatars/avatar_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/models/avatars/avatar.go b/models/avatars/avatar.go index 6cf05dd284..265ee6428e 100644 --- a/models/avatars/avatar.go +++ b/models/avatars/avatar.go @@ -153,7 +153,7 @@ func generateEmailAvatarLink(ctx context.Context, email string, size int, final return DefaultAvatarLink() } - enableFederatedAvatar := system_model.GetSettingBool(ctx, system_model.KeyPictureEnableFederatedAvatar) + enableFederatedAvatar := system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureEnableFederatedAvatar) var err error if enableFederatedAvatar && system_model.LibravatarService != nil { @@ -174,7 +174,7 @@ func generateEmailAvatarLink(ctx context.Context, email string, size int, final return urlStr } - disableGravatar := system_model.GetSettingBool(ctx, system_model.KeyPictureDisableGravatar) + disableGravatar := system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureDisableGravatar) if !disableGravatar { // copy GravatarSourceURL, because we will modify its Path. avatarURLCopy := *system_model.GravatarSourceURL diff --git a/models/avatars/avatar_test.go b/models/avatars/avatar_test.go index a3cb36d0e1..59daaeb669 100644 --- a/models/avatars/avatar_test.go +++ b/models/avatars/avatar_test.go @@ -28,7 +28,7 @@ func enableGravatar(t *testing.T) { err := system_model.SetSettingNoVersion(db.DefaultContext, system_model.KeyPictureDisableGravatar, "false") assert.NoError(t, err) setting.GravatarSource = gravatarSource - err = system_model.Init() + err = system_model.Init(db.DefaultContext) assert.NoError(t, err) } |