diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2014-02-06 13:20:42 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2014-02-06 13:20:42 +0100 |
commit | eb62fcc17f5deb107cac947b5346c74b60d6da9e (patch) | |
tree | 5b76feb2799e2e5680d181f8bdefffd4af1466ff /pyaggr3g470r/views.py | |
parent | Updated all links to /articles page. (diff) | |
download | newspipe-eb62fcc17f5deb107cac947b5346c74b60d6da9e.tar.gz newspipe-eb62fcc17f5deb107cac947b5346c74b60d6da9e.tar.bz2 newspipe-eb62fcc17f5deb107cac947b5346c74b60d6da9e.zip |
Check if the number of articles is not greater than the parameter.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r-- | pyaggr3g470r/views.py | 2 |
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) |