aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-04-09 11:56:27 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-04-12 14:31:06 +0200
commitdcf258d6741254c2176b287e86435cbe46316a41 (patch)
treeb5d94b67b05a066c7e4a226677692354e25071fa /pyaggr3g470r
parentno more target, no more going back on the top of the page (diff)
downloadnewspipe-dcf258d6741254c2176b287e86435cbe46316a41.tar.gz
newspipe-dcf258d6741254c2176b287e86435cbe46316a41.tar.bz2
newspipe-dcf258d6741254c2176b287e86435cbe46316a41.zip
auto redirect to the all including filter when landing on no result
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/views/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index 27dce8a9..fb2a5f87 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -254,10 +254,14 @@ def home():
def gen_url(filter_=filter_, limit=limit, feed=feed_id):
return url_for('home', filter_=filter_, limit=limit, feed=feed)
+
+ articles = list(articles)
+ if not articles:
+ return redirect(gen_url(filter_='all'))
+
return render_template('home.html', gen_url=gen_url, feed_id=feed_id,
filter_=filter_, limit=limit, feeds=feeds,
- unread=unread, articles=list(articles),
- in_error=in_error,
+ unread=unread, articles=articles, in_error=in_error,
default_max_error = conf.DEFAULT_MAX_ERROR)
bgstack15