aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/admin.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-15 14:24:41 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-15 14:24:41 +0100
commit4163ea26ee2b04e5d78345f6505bb375ef0d3882 (patch)
treee59c550b6c813a3c8dac271a4f9f48c6e918fbe0 /src/web/views/admin.py
parentFixed a bug when existing_article.updated_date is None. (diff)
downloadnewspipe-4163ea26ee2b04e5d78345f6505bb375ef0d3882.tar.gz
newspipe-4163ea26ee2b04e5d78345f6505bb375ef0d3882.tar.bz2
newspipe-4163ea26ee2b04e5d78345f6505bb375ef0d3882.zip
It is again possible (for an administrator) to delete the feed of a user.
Diffstat (limited to 'src/web/views/admin.py')
-rw-r--r--src/web/views/admin.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/web/views/admin.py b/src/web/views/admin.py
index ec79262d..753b864f 100644
--- a/src/web/views/admin.py
+++ b/src/web/views/admin.py
@@ -7,7 +7,7 @@ from flask.ext.principal import Permission, RoleNeed
from web.lib.utils import redirect_url
from web.models import Role
-from web.controllers import UserController, ArticleController
+from web.controllers import UserController, ArticleController, FeedController
from web.forms import InformationMessageForm, UserForm
from web import notifications
@@ -130,6 +130,18 @@ def delete_user(user_id=None):
'%(error)', error=error), 'danger')
return redirect(redirect_url())
+@admin_bp.route('/delete/<feed_id>', methods=['GET'])
+@login_required
+@admin_permission.require(http_exception=403)
+def delete(feed_id=None):
+ "Deletes the feed of a user."
+ try:
+ feed = FeedController().delete(feed_id)
+ flash(gettext("Feed successfully deleted."), 'success')
+ except Exception as error:
+ flash('An error occured while trying to delete a feed: '
+ + str(error), 'danger')
+ return redirect(url_for('home'))
@admin_bp.route('/toggle_user/<int:user_id>', methods=['GET'])
@login_required
bgstack15