|
|
|
@ -1,3 +1,5 @@ |
|
|
|
|
|
|
|
import os |
|
|
|
|
|
|
|
|
|
|
|
from uuid import uuid4 |
|
|
|
from uuid import uuid4 |
|
|
|
from urllib.parse import urlsplit |
|
|
|
from urllib.parse import urlsplit |
|
|
|
|
|
|
|
|
|
|
|
@ -182,7 +184,7 @@ class FacebookLoginOrRegistration(View): |
|
|
|
login(requests, user=user) |
|
|
|
login(requests, user=user) |
|
|
|
return JsonResponse({"success": True}) |
|
|
|
return JsonResponse({"success": True}) |
|
|
|
else: |
|
|
|
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) |
|
|
|
photo = ContentFile(photo_data) |
|
|
|
fname = str(fb_id) + '.jpg' |
|
|
|
fname = str(fb_id) + '.jpg' |
|
|
|
user.photo.save(fname, photo, save=True) |
|
|
|
user.photo.save(fname, photo, save=True) |
|
|
|
|