tune migrations
This commit is contained in:
parent
2ab5748105
commit
58e9c4eb59
2 changed files with 6 additions and 2 deletions
|
@ -6,4 +6,4 @@ djlint~=1.34.0
|
|||
isort~=5.12.0
|
||||
lxml-stubs
|
||||
pre-commit
|
||||
pyright==1.1.336
|
||||
pyright==1.1.338
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from datetime import datetime, timezone
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.management.base import BaseCommand
|
||||
|
@ -19,6 +21,8 @@ from users.models import User as NeoUser
|
|||
|
||||
BATCH_SIZE = 1000
|
||||
|
||||
TIMELINE_START = datetime.datetime(2023, 7, 1, tzinfo=timezone.utc)
|
||||
|
||||
|
||||
def content_type_id(cls):
|
||||
return ContentType.objects.get(app_label="journal", model=cls.__name__.lower()).pk
|
||||
|
@ -115,7 +119,7 @@ class Command(BaseCommand):
|
|||
published=post.published,
|
||||
)
|
||||
)
|
||||
if post.visibility != 3:
|
||||
if post.visibility != 3 and post.published > TIMELINE_START:
|
||||
for follower_id in followers[post.author_id]:
|
||||
events.append(
|
||||
TimelineEvent(
|
||||
|
|
Loading…
Add table
Reference in a new issue