diff options
-rwxr-xr-x | pyAggr3g470r.py | 13 | ||||
-rwxr-xr-x | utils.py | 10 |
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 @@ -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): """ |