X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/9b46fa5812ae6d152cef155956b435b4ba034df8..32e632734c0a8390775bb8661edc78c2045cf5f3:/src/social/models.py diff --git a/src/social/models.py b/src/social/models.py index e50ff0775..c41a78f67 100644 --- a/src/social/models.py +++ b/src/social/models.py @@ -4,7 +4,6 @@ from datetime import datetime import uuid from oauthlib.common import urlencode, generate_token -from pytz import utc from random import randint from django.db import models from django.conf import settings @@ -12,7 +11,7 @@ from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.mail import send_mail from django.urls import reverse -from django.utils.timezone import now +from django.utils.timezone import now, utc from catalogue.models import Book from catalogue.utils import get_random_hash from wolnelektury.utils import cached_render, clear_cached_renders @@ -337,12 +336,14 @@ class UserList(Syncable, models.Model): favorites=True ) except cls.DoesNotExist: + n = now() if create: return cls.objects.create( user=user, favorites=True, - slug=get_random_hash(name), - updated_at=now() + slug=get_random_hash('favorites'), + updated_at=n, + reported_timestamp=n, ) else: return None