Redo nuke functionality (#459)

This started out as a simple rebase, but then I rebased the wrong
branches and it all got confusing, so here it is as a new dank
commit.

We now have an @admin_only decorator, and we ask for confirmation
before we nuke. We can also see the nuke button when users are
banned, and nuking is a separate endpoint with a separate form.

Additionally, it now uses the new tracker API.
This commit is contained in:
Nicolas F
2018-03-26 01:24:44 +02:00
committed by Arylide
parent 81806d7bc9
commit c405f49eb6
4 changed files with 72 additions and 43 deletions

View File

@@ -284,7 +284,6 @@ class DeleteForm(FlaskForm):
class BanForm(FlaskForm):
ban_user = SubmitField("Delete & Ban and Ban User")
ban_userip = SubmitField("Delete & Ban and Ban User+IP")
nuke = SubmitField("Delete & Ban all torrents")
unban = SubmitField("Unban")
_validator = DataRequired()
@@ -299,6 +298,10 @@ class BanForm(FlaskForm):
])
class NukeForm(FlaskForm):
nuke_torrents = SubmitField("\U0001F4A3 Nuke Torrents")
class UploadForm(FlaskForm):
torrent_file = FileField('Torrent file', [
FileRequired()