aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/article.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-04-06 10:37:13 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-04-06 10:37:13 +0200
commit29bb2a36f0b5d1781ab05f1976aa0c5017351807 (patch)
tree52b2dd87f4d36f6a9c518cc14f96e523b1dea045 /pyaggr3g470r/views/article.py
parentmisc update (diff)
parentMinor changes to the CSS. (diff)
downloadnewspipe-29bb2a36f0b5d1781ab05f1976aa0c5017351807.tar.gz
newspipe-29bb2a36f0b5d1781ab05f1976aa0c5017351807.tar.bz2
newspipe-29bb2a36f0b5d1781ab05f1976aa0c5017351807.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: pyaggr3g470r/controllers/feed.py pyaggr3g470r/templates/home.html
Diffstat (limited to 'pyaggr3g470r/views/article.py')
-rw-r--r--pyaggr3g470r/views/article.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pyaggr3g470r/views/article.py b/pyaggr3g470r/views/article.py
index 66cc0f37..08c92686 100644
--- a/pyaggr3g470r/views/article.py
+++ b/pyaggr3g470r/views/article.py
@@ -1,3 +1,6 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -
+
from flask import Blueprint, g, render_template, redirect
from sqlalchemy import desc
@@ -18,10 +21,9 @@ def articles(feed_id=None, nb_articles=-1):
feed.articles = controllers.ArticleController(g.user.id)\
.read(feed_id=feed.id)\
.order_by(desc("Article.date"))
- if len(feed.articles.all()) <= nb_articles:
- nb_articles = -1
- if nb_articles == -1:
- feed.articles = feed.articles.limit(nb_articles)
+ if len(feed.articles.all()) <= nb_articles or nb_articles == -1:
+ nb_articles = int(1e9)
+ feed.articles = feed.articles.limit(nb_articles)
return render_template('articles.html', feed=feed, nb_articles=nb_articles)
bgstack15