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,
}
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):
return True
def is_duplicate(self, existing_post: Post, values: Dict) -> bool:
for key, value in values.items():
existing_value = getattr(existing_post, key, object())
existing_value = getattr(existing_post, key, None)
if existing_value != value:
return False