Fix update photo from fb

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 12a3d528e8
commit b261ee692d
  1. 4
      apps/auth/views.py

@ -1,3 +1,5 @@
import os
from uuid import uuid4
from urllib.parse import urlsplit
@ -182,7 +184,7 @@ class FacebookLoginOrRegistration(View):
login(requests, user=user)
return JsonResponse({"success": True})
else:
if not user.photo and photo_data:
if (not user.photo or (user.photo and not os.path.isfile(user.photo.path))) and photo_data:
photo = ContentFile(photo_data)
fname = str(fb_id) + '.jpg'
user.photo.save(fname, photo, save=True)

Loading…
Cancel
Save