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
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
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