aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-07-10 14:10:34 +0200
committerCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-07-10 14:10:34 +0200
commit3cb10b3a240d0419338f4f8df26c684ef3ebdf92 (patch)
tree12b8cc24e0ef68c95c6950e306c4494ed3c1f273 /pyaggr3g470r/views
parentMerge branch 'master' of bitbucket.org:cedricbonhomme/pyaggr3g470r (diff)
parentrebuilding feed url as well (diff)
downloadnewspipe-3cb10b3a240d0419338f4f8df26c684ef3ebdf92.tar.gz
newspipe-3cb10b3a240d0419338f4f8df26c684ef3ebdf92.tar.bz2
newspipe-3cb10b3a240d0419338f4f8df26c684ef3ebdf92.zip
Merged in jaesivsm/pyaggr3g470r (pull request #18)
bookmarlet & navbar form improvement
Diffstat (limited to 'pyaggr3g470r/views')
-rw-r--r--pyaggr3g470r/views/feed.py7
-rw-r--r--pyaggr3g470r/views/views.py11
2 files changed, 6 insertions, 12 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)
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index a4e799cc..189fd53f 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -137,17 +137,6 @@ def get_timezone():
except:
return conf.TIME_ZONE["en"]
-
-@app.context_processor
-def inject_feed_form():
- """
- Injects the 'AddFeedForm' objects in all templates.
-
- Context processors run before the template is rendered and have the
- ability to inject new values into the template context.
- """
- return dict(create_feed_form=AddFeedForm())
-
#
# Views.
#
bgstack15