Skip to content

Commit

Permalink
Merge pull request #140 from liangliangyy/dev
Browse files Browse the repository at this point in the history
将用户头像保存本地
  • Loading branch information
liangliangyy committed Jul 18, 2018
2 parents 6f4846e + a441000 commit 218e3b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def authorize(request):
user = manager.get_oauth_userinfo()
logger.info('user:' + user.nikename)
if user:
if user.picture:
user.picture = save_user_avatar(user.picture)
if not user.nikename:
import datetime
user.nikename = "djangoblog" + datetime.datetime.now().strftime('%y%m%d%I%M%S')
Expand All @@ -61,8 +63,6 @@ def authorize(request):
except ObjectDoesNotExist:
pass
# facebook的token过长
if user.picture:
user.picture = save_user_avatar(user.picture)
if type == 'facebook':
user.token = ''
email = user.email
Expand Down

0 comments on commit 218e3b3

Please sign in to comment.