aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/views')
-rw-r--r--pyaggr3g470r/views/views.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index c905c6e5..3b018c6d 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -236,7 +236,9 @@ def signup():
return render_template('signup.html', form=form)
-def render_home(filters={}, head_title='', page_to_render='home', **kwargs):
+def render_home(filters=None, head_title='', page_to_render='home', **kwargs):
+ if filters is None:
+ filters = {}
feed_contr = FeedController(g.user.id)
arti_contr = ArticleController(g.user.id)
feeds = {feed.id: feed.title for feed in feed_contr.read()}
@@ -248,7 +250,7 @@ def render_home(filters={}, head_title='', page_to_render='home', **kwargs):
filter_ = request.args.get('filter_',
'unread' if page_to_render == 'home' else 'all')
sort_ = request.args.get('sort_', 'date')
- feed_id = int(request.args.get('feed', 0))
+ feed_id = int(request.args.get('feed_id', 0))
limit = request.args.get('limit', 1000)
if filter_ != 'all':
@@ -269,14 +271,14 @@ def render_home(filters={}, head_title='', page_to_render='home', **kwargs):
limit = int(limit)
articles = articles.limit(limit)
- def gen_url(filter_=filter_, sort_=sort_, limit=limit, feed=feed_id,
+ def gen_url(filter_=filter_, sort_=sort_, limit=limit, feed_id=feed_id,
**kwargs):
if page_to_render == 'search':
kwargs['query'] = request.args.get('query', '')
kwargs['search_title'] = request.args.get('search_title', 'on')
kwargs['search_content'] = request.args.get('searc_content', 'off')
return url_for(page_to_render, filter_=filter_, sort_=sort_,
- limit=limit, feed=feed, **kwargs)
+ limit=limit, feed_id=feed_id, **kwargs)
articles = list(articles)
if (page_to_render == 'home' and feed_id or page_to_render == 'search') \
bgstack15