diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-11-02 17:42:31 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-11-02 17:42:31 +0100 |
commit | d84e10ac976c38e95f340b397d566e8ac3e89c39 (patch) | |
tree | d10540a0e867ca3e72da2a28b1394c7e827fe69e /pyaggr3g470r/views.py | |
parent | Another minor bugfix... (diff) | |
download | newspipe-d84e10ac976c38e95f340b397d566e8ac3e89c39.tar.gz newspipe-d84e10ac976c38e95f340b397d566e8ac3e89c39.tar.bz2 newspipe-d84e10ac976c38e95f340b397d566e8ac3e89c39.zip |
Bugfix when deleting an entire feed.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r-- | pyaggr3g470r/views.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 9b940381..f93f276f 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -129,7 +129,7 @@ def delete(article_id=None): @app.route('/delete_feed/<feed_id>', methods=['GET']) @login_required def delete_feed(feed_id=None): - user = models.User.objects(email=g.user.email, feeds__oid=feed_id).first() + user = models.User.objects(email=g.user.email).first() # delete all articles (Document objects) for feed in user.feeds: if str(feed.oid) == feed_id: @@ -137,7 +137,7 @@ def delete_feed(feed_id=None): article.delete() feed.articles = [] # delete the feed (EmbeddedDocument object) - models.User.objects(email=g.user.email, feeds__oid=feed_id).update_one(pull__feeds__oid = feed_id) + user.feeds.remove(feed) user.save() return redirect(url_for('home')) |