[29711] Allow overrdiing gravatar default in configuration

[ci skip]

https://community.openproject.com/wp/29711
pull/7231/head
Oliver Günther 6 years ago
parent 8f8168a495
commit 3d07160dfd
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 8
      docs/configuration/configuration.md
  2. 3
      lib/open_project/configuration.rb
  3. 2
      modules/avatars/lib/open_project/avatars/patches/avatar_helper_patch.rb

@ -135,6 +135,14 @@ If this option is active /login will lead directly to the configured omniauth pr
Note that this does not stop a user from manually navigating to any other
omniauth provider if additional ones are configured.
### Gravatar images
OpenProject uses gravatar images with a `404` fallback by default to render an internal, initials-based avatar.
You can override this behavior by setting `gravatar_fallback_image` to a different value.
For supported values, please see https://en.gravatar.com/site/implement/images/
### attachments storage
*default: file*

@ -129,6 +129,9 @@ module OpenProject
# Allow in-context translations to be loaded with CSP
'crowdin_in_context_translations' => true,
# Default gravatar image, set to something other than 404
# to ensure a default is returned
'gravatar_fallback_image' => '404',
'registration_footer' => {},

@ -119,7 +119,7 @@ AvatarHelper.class_eval do
def default_gravatar_options
options = { secure: Setting.protocol == 'https' }
options[:default] = '404'
options[:default] = OpenProject::Configuration.gravatar_fallback_image
options
end

Loading…
Cancel
Save