aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-07-05 16:38:26 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-07-06 09:04:58 +0200
commitd08cc46087d3349aff7b06908c70d97fecbdec8f (patch)
treeeed30e3659312afabaff44d5009b5063df08a83d /pyaggr3g470r/views
parentfixing bug on reset link for feeds and hidding feed title for eXtraSmall device (diff)
downloadnewspipe-d08cc46087d3349aff7b06908c70d97fecbdec8f.tar.gz
newspipe-d08cc46087d3349aff7b06908c70d97fecbdec8f.tar.bz2
newspipe-d08cc46087d3349aff7b06908c70d97fecbdec8f.zip
constructing feed from normal url also
Diffstat (limited to 'pyaggr3g470r/views')
-rw-r--r--pyaggr3g470r/views/feed.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py
index 8bd2f8e9..d31aa212 100644
--- a/pyaggr3g470r/views/feed.py
+++ b/pyaggr3g470r/views/feed.py
@@ -12,6 +12,7 @@ from flask.ext.login import login_required
import conf
from pyaggr3g470r import utils
+from pyaggr3g470r.lib.utils import construct_feed_from
from pyaggr3g470r.forms import AddFeedForm
from pyaggr3g470r.controllers import FeedController, ArticleController
@@ -94,14 +95,14 @@ def bookmarklet():
flash(gettext("Couldn't add feed: url missing."), "error")
raise BadRequest("url is missing")
- existing_feeds = list(feed_contr.read(link=url))
- if existing_feeds:
+ feed_exists = list(feed_contr.read(__or__={'link': url, 'site_link': url}))
+ if feed_exists:
flash(gettext("Couldn't add feed: feed already exists."),
"warning")
return redirect(url_for('feed.form',
feed_id=existing_feeds[0].id))
- feed = feed_contr.create(link=url)
+ feed = feed_contr.create(**construct_feed_from(url))
flash(gettext('Feed was successfully created.'), 'success')
if conf.CRAWLING_METHOD == "classic":
utils.fetch(g.user.id, feed.id)
bgstack15