aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/crawler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pyaggr3g470r/crawler.py b/pyaggr3g470r/crawler.py
index 0f820373..c3978413 100644
--- a/pyaggr3g470r/crawler.py
+++ b/pyaggr3g470r/crawler.py
@@ -230,11 +230,11 @@ class FeedGetter(object):
"""
logger.info("Database insertion...")
new_articles = []
+ query1 = Article.query.filter(Article.user_id == self.user.id)
for feed, articles in elements:
+ query2 = query1.filter(Article.feed_id == feed.id)
for article in articles:
- exist = Article.query.filter(Article.user_id == self.user.id,
- Article.feed_id == feed.id,
- Article.link == article.link).count() != 0
+ exist = query2.filter(Article.link == article.link).count() != 0
if exist:
logger.debug("Article %r (%r) already in the database.",
article.title, article.link)
bgstack15