Allow enterprise deployments to disable the use of Gravatar.

(imported from commit 49c14cc7629f2ffe6cedaab5d42ad5bf7f6569a4)
This commit is contained in:
Kevin Mehall 2013-11-15 16:25:02 -05:00
parent 9cba43d49c
commit a63f4284f0
5 changed files with 8 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -36,6 +36,8 @@ def get_avatar_url(avatar_source, email):
else:
bucket = settings.S3_AVATAR_BUCKET
return "https://%s.s3.amazonaws.com/%s?x=x" % (bucket, hash_key)
else:
elif settings.ENABLE_GRAVATAR:
hash_key = gravatar_hash(email)
return "https://secure.gravatar.com/avatar/%s?d=identicon" % (hash_key,)
else:
return '/static/images/default-avatar.png?x=x'

View File

@ -81,6 +81,10 @@ LOCAL_UPLOADS_DIR = "/home/zulip/uploads"
# This is useful in settings where you're syncing names from an integrated LDAP/Active Directory
NAME_CHANGES_DISABLED = False
# Controls whether users who have not uploaded an avatar will receive an avatar
# from gravatar.com.
ENABLE_GRAVATAR = True
### TWITTER INTEGRATION
# Zulip supports showing inline Tweet previews when a tweet is linked

View File

@ -265,6 +265,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
'INLINE_IMAGE_PREVIEW': True,
'CAMO_URI': None,
'ENABLE_FEEDBACK': True,
'ENABLE_GRAVATAR': True,
}
for setting_name, setting_val in DEFAULT_SETTINGS.iteritems():