increase duplicate handler's history range

This commit is contained in:
Sonny 2019-07-15 08:29:24 +02:00
parent a74ffae9a7
commit b1c5be61f1

View file

@ -188,13 +188,13 @@ class FeedDuplicateHandler:
"publication_date": post.publication_date, "publication_date": post.publication_date,
} }
for existing_post in self.queryset.order_by("-publication_date")[:50]: for existing_post in self.queryset.order_by("-publication_date")[:500]:
if self.is_duplicate(existing_post, values): if self.is_duplicate(existing_post, values):
return True return True
def is_duplicate(self, existing_post: Post, values: Dict) -> bool: def is_duplicate(self, existing_post: Post, values: Dict) -> bool:
for key, value in values.items(): for key, value in values.items():
existing_value = getattr(existing_post, key, object()) existing_value = getattr(existing_post, key, None)
if existing_value != value: if existing_value != value:
return False return False