diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-09 21:48:43 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-09 21:48:43 +0200 |
commit | 00df563d08b9ab161b4be29e9ffdce0f1269bd16 (patch) | |
tree | dd5563a706a987d95b17b4f4339fb51f22d130b1 | |
parent | Delete a feed and its articles. (diff) | |
download | newspipe-00df563d08b9ab161b4be29e9ffdce0f1269bd16.tar.gz newspipe-00df563d08b9ab161b4be29e9ffdce0f1269bd16.tar.bz2 newspipe-00df563d08b9ab161b4be29e9ffdce0f1269bd16.zip |
Articles's link are not unique.
-rw-r--r-- | pyaggr3g470r/feedgetter.py | 4 | ||||
-rw-r--r-- | pyaggr3g470r/models.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py index 96917fcf..2539124b 100644 --- a/pyaggr3g470r/feedgetter.py +++ b/pyaggr3g470r/feedgetter.py @@ -149,6 +149,10 @@ class FeedGetter(object): parsed_url.fragment ]) + exist = Article.query.filter(Article.link == nice_url).first() + if exist != None and exist.source.subscriber.id == self.user.id: + continue + description = "" article_title = "" try: diff --git a/pyaggr3g470r/models.py b/pyaggr3g470r/models.py index b1cd3448..491e1369 100644 --- a/pyaggr3g470r/models.py +++ b/pyaggr3g470r/models.py @@ -110,7 +110,7 @@ class Article(db.Model): Represent an article from a feed. """ id = db.Column(db.Integer, primary_key = True) - link = db.Column(db.String(), unique = True) + link = db.Column(db.String()) title = db.Column(db.String()) content = db.Column(db.String()) readed = db.Column(db.Boolean(), default=False) |