aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2014-02-06 13:20:42 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2014-02-06 13:20:42 +0100
commiteb62fcc17f5deb107cac947b5346c74b60d6da9e (patch)
tree5b76feb2799e2e5680d181f8bdefffd4af1466ff
parentUpdated all links to /articles page. (diff)
downloadnewspipe-eb62fcc17f5deb107cac947b5346c74b60d6da9e.tar.gz
newspipe-eb62fcc17f5deb107cac947b5346c74b60d6da9e.tar.bz2
newspipe-eb62fcc17f5deb107cac947b5346c74b60d6da9e.zip
Check if the number of articles is not greater than the parameter.
-rw-r--r--pyaggr3g470r/views.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 02495311..668ec141 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -249,6 +249,8 @@ def articles(feed_id=None, nb_articles=-1):
user = models.User.objects(email=g.user.email, feeds__oid=feed_id).first()
for feed in user.feeds:
if str(feed.oid) == feed_id:
+ if len(feed.articles) <= nb_articles:
+ nb_articles = -1
if nb_articles != -1:
feed.articles = feed.articles[0:nb_articles]
return render_template('articles.html', feed=feed, nb_articles=nb_articles)
bgstack15