aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2012-03-10 08:52:28 +0100
committercedricbonhomme <devnull@localhost>2012-03-10 08:52:28 +0100
commit4bf97ac3fb1589efff74439402e716ea94bea97e (patch)
tree38fc2c4fb031288269b2ca1b4cb389c741d8e9be
parentBetter code of the management page. (diff)
downloadnewspipe-4bf97ac3fb1589efff74439402e716ea94bea97e.tar.gz
newspipe-4bf97ac3fb1589efff74439402e716ea94bea97e.tar.bz2
newspipe-4bf97ac3fb1589efff74439402e716ea94bea97e.zip
We can now again delete a feed from the management page.
-rwxr-xr-xpyAggr3g470r.py13
-rwxr-xr-xutils.py10
2 files changed, 7 insertions, 16 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index e9edd6f0..a9745bac 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -1108,12 +1108,13 @@ class Root:
html = htmlheader()
html += htmlnav
html += """<div class="left inner">"""
- try:
- utils.remove_feed(self.feeds[feed_id].feed_link)
- html += """<p>All articles from the feed <i>%s</i> are now removed from the base.</p><br />""" % \
- (self.feeds[feed_id].feed_title,)
- except:
- return self.error_page("This feed do not exists.")
+
+ feed = self.mongo.get_collection(feed_id)
+ self.mongo.delete_feed(feed_id)
+ utils.remove_feed(feed["feed_link"])
+
+ html += """<p>All articles from the feed <i>%s</i> are now removed from the base.</p><br />""" % \
+ (feed["feed_title"],)
html += """<a href="/management/">Back to the management page.</a><br />\n"""
html += "<hr />\n"
html += htmlfooter
diff --git a/utils.py b/utils.py
index d789f006..047ed329 100755
--- a/utils.py
+++ b/utils.py
@@ -335,16 +335,6 @@ def remove_feed(feed_url):
feeds.append(line.replace("\n", ""))
with open("./var/feed.lst", "w") as f:
f.write("\n".join(feeds) + "\n")
- # Remove articles from this feed from the SQLite base.
- try:
- conn = sqlite3.connect(sqlite_base, isolation_level = None)
- c = conn.cursor()
- c.execute("DELETE FROM feeds WHERE feed_link='" + feed_url +"'")
- c.execute("DELETE FROM articles WHERE feed_link='" + feed_url +"'")
- conn.commit()
- c.close()
- except:
- pass
def search_feed(url):
"""
bgstack15