From ef6c92271c06615c0cab6caa3650e35e4233aa1e Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 14 Apr 2015 08:06:54 +0200 Subject: Automatically download articles for the new feed. --- pyaggr3g470r/views/feed.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py index af43d6f0..846df06d 100644 --- a/pyaggr3g470r/views/feed.py +++ b/pyaggr3g470r/views/feed.py @@ -134,8 +134,6 @@ def form(feed_id=None): if request.method == 'POST': if not form.validate(): - print(dir(form)) - print("oups") return render_template('edit_feed.html', form=form) existing_feeds = list(feed_contr.read(link=form.link.data)) if existing_feeds and feed_id is None: @@ -144,7 +142,6 @@ def form(feed_id=None): return redirect(url_for('feed.form', feed_id=existing_feeds[0].id)) # Edit an existing feed - print("new...") if feed_id is not None: feed_contr.update({'id': feed_id}, {'title': form.title.data, @@ -156,7 +153,6 @@ def form(feed_id=None): return redirect(url_for('feed.form', feed_id=feed_id)) # Create a new feed - print("new feed") new_feed = FeedController(g.user.id).create( title=form.title.data, description="", @@ -167,6 +163,9 @@ def form(feed_id=None): flash(gettext('Feed %(feed_title)r successfully created.', feed_title=new_feed.title), 'success') + utils.fetch(g.user.id, new_feed.id) + flash(gettext("Downloading articles for the new feed..."), 'info') + return redirect(url_for('feed.form', feed_id=new_feed.id)) -- cgit