mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-16 08:19:05 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user