diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-07-07 10:58:00 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-07-07 10:58:00 +0200 |
commit | 5091c44181db05822e27b58a145de56395795768 (patch) | |
tree | 4e0b6d97497e9762e9a9d0680062fac1fe19fa86 /pyaggr3g470r | |
parent | using bookmarklet for adding feed from navbar (diff) | |
download | newspipe-5091c44181db05822e27b58a145de56395795768.tar.gz newspipe-5091c44181db05822e27b58a145de56395795768.tar.bz2 newspipe-5091c44181db05822e27b58a145de56395795768.zip |
protecting pyagg against empty feed
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/views/feed.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py index 18e110af..86d07e18 100644 --- a/pyaggr3g470r/views/feed.py +++ b/pyaggr3g470r/views/feed.py @@ -102,7 +102,12 @@ def bookmarklet(): "warning") return redirect(url_for('feed.form', feed_id=feed_exists[0].id)) - feed = feed_contr.create(**construct_feed_from(url)) + feed = construct_feed_from(url) + if not feed.get('link'): + feed['enabled'] = False + flash(gettext("Couldn't find a feed url, you'll need to find a Atom or" + "RSS link manually and reactivate this feed"), 'warning') + feed = feed_contr.create(**feed) flash(gettext('Feed was successfully created.'), 'success') if conf.CRAWLING_METHOD == "classic": utils.fetch(g.user.id, feed.id) |