Thumbnails for images and videos #87
@ -6,6 +6,7 @@ from django.contrib.auth import get_user_model
|
|||||||
from django.contrib.auth.models import Group
|
from django.contrib.auth.models import Group
|
||||||
from django.db.models.signals import m2m_changed, pre_save
|
from django.db.models.signals import m2m_changed, pre_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
from django.utils.dateparse import parse_datetime
|
||||||
|
|
||||||
from blender_id_oauth_client import signals as bid_signals
|
from blender_id_oauth_client import signals as bid_signals
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ def update_user(
|
|||||||
Copy 'full_name' from the received 'oauth_info' and attempt to copy avatar from Blender ID.
|
Copy 'full_name' from the received 'oauth_info' and attempt to copy avatar from Blender ID.
|
||||||
"""
|
"""
|
||||||
instance.full_name = oauth_info.get('full_name') or ''
|
instance.full_name = oauth_info.get('full_name') or ''
|
||||||
instance.confirmed_email_at = oauth_info.get('confirmed_email_at')
|
instance.confirmed_email_at = parse_datetime(oauth_info.get('confirmed_email_at'))
|
||||||
instance.save()
|
instance.save()
|
||||||
|
|
||||||
bid.copy_avatar_from_blender_id(user=instance)
|
bid.copy_avatar_from_blender_id(user=instance)
|
||||||
|
@ -11,6 +11,7 @@ from django.core.exceptions import ObjectDoesNotExist
|
|||||||
from django.db.utils import IntegrityError
|
from django.db.utils import IntegrityError
|
||||||
from django.http import HttpResponse, HttpResponseBadRequest
|
from django.http import HttpResponse, HttpResponseBadRequest
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
from django.utils.dateparse import parse_datetime
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
from django.views.decorators.http import require_POST
|
from django.views.decorators.http import require_POST
|
||||||
|
|
||||||
@ -107,7 +108,7 @@ def handle_user_modified(payload: Dict[Any, Any]) -> None:
|
|||||||
update_fields.add('full_name')
|
update_fields.add('full_name')
|
||||||
|
|
||||||
if 'confirmed_email_at' in payload:
|
if 'confirmed_email_at' in payload:
|
||||||
user.confirmed_email_at = payload['confirmed_email_at']
|
user.confirmed_email_at = parse_datetime(payload['confirmed_email_at'])
|
||||||
update_fields.add('confirmed_email_at')
|
update_fields.add('confirmed_email_at')
|
||||||
|
|
||||||
if update_fields:
|
if update_fields:
|
||||||
|
Loading…
Reference in New Issue
Block a user