Fix if user login to site with FB and not have photo then set photo from FB

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent ea77f06356
commit ca5e7da4cc
  1. 4
      apps/auth/views.py

@ -169,5 +169,9 @@ class FacebookLoginOrRegistration(View):
login(requests, user=user)
return JsonResponse({"success": True})
else:
if not user.photo and photo_data:
photo = ContentFile(photo_data)
fname = str(fb_id) + '.jpg'
user.photo.save(fname, photo, save=True)
login(requests, user=user)
return JsonResponse({"success": True})

Loading…
Cancel
Save