0.2.3 #99

Merged
sonny merged 112 commits from development into master 2020-05-23 16:58:42 +02:00
Showing only changes of commit b1c5be61f1 - Show all commits

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