Merge pull request #577 from xiuyuanjun/dev_gravatar_202204202136

优化代码--获得gravatar头像缓存部分
且听风吟 4 years ago committed by GitHub
commit 14200e9ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -285,8 +285,9 @@ def load_article_detail(article, isindex, user):
def gravatar_url(email, size=40):
"""获得gravatar头像"""
cachekey = 'gravatat/' + email
if cache.get(cachekey):
return cache.get(cachekey)
url = cache.get(cachekey)
if url:
return url
else:
usermodels = OAuthUser.objects.filter(email=email)
if usermodels:

Loading…
Cancel
Save