Allow overriding the default avatar image

(imported from commit 66d413682a822e0019f28033f19908bdd9fa0156)
This commit is contained in:
Kevin Mehall
2013-11-18 10:58:39 -05:00
parent 3a4b576135
commit b78fa0857f
3 changed files with 7 additions and 1 deletions

View File

@@ -40,4 +40,4 @@ def get_avatar_url(avatar_source, email):
hash_key = gravatar_hash(email) hash_key = gravatar_hash(email)
return "https://secure.gravatar.com/avatar/%s?d=identicon" % (hash_key,) return "https://secure.gravatar.com/avatar/%s?d=identicon" % (hash_key,)
else: else:
return '/static/images/default-avatar.png?x=x' return settings.DEFAULT_AVATAR_URI+'?x=x'

View File

@@ -85,6 +85,11 @@ NAME_CHANGES_DISABLED = False
# from gravatar.com. # from gravatar.com.
ENABLE_GRAVATAR = True ENABLE_GRAVATAR = True
# To override the default avatar image if ENABLE_GRAVATAR is False, place your
# custom default avatar image at /home/zulip/local-static/default-avatar.png
# and uncomment the following line.
#DEFAULT_AVATAR_URI = '/local-static/default-avatar.png'
### TWITTER INTEGRATION ### TWITTER INTEGRATION
# Zulip supports showing inline Tweet previews when a tweet is linked # Zulip supports showing inline Tweet previews when a tweet is linked

View File

@@ -266,6 +266,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
'CAMO_URI': None, 'CAMO_URI': None,
'ENABLE_FEEDBACK': True, 'ENABLE_FEEDBACK': True,
'ENABLE_GRAVATAR': True, 'ENABLE_GRAVATAR': True,
'DEFAULT_AVATAR_URI': '/static/images/default-avatar.png',
} }
for setting_name, setting_val in DEFAULT_SETTINGS.iteritems(): for setting_name, setting_val in DEFAULT_SETTINGS.iteritems():