From 8de2663fc28821f63d731312617cf00f90cac62d Mon Sep 17 00:00:00 2001 From: nyaadev Date: Fri, 16 Feb 2018 19:58:31 +0100 Subject: [PATCH] Remove deprecated torrent delete code. --- nyaa/forms.py | 1 - nyaa/views/torrents.py | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/nyaa/forms.py b/nyaa/forms.py index 97c9e26..db468d0 100644 --- a/nyaa/forms.py +++ b/nyaa/forms.py @@ -259,7 +259,6 @@ class EditForm(FlaskForm): field.parsed_data = cat is_hidden = BooleanField('Hidden') - is_deleted = BooleanField('Deleted') is_remake = BooleanField('Remake') is_anonymous = BooleanField('Anonymous') is_complete = BooleanField('Complete') diff --git a/nyaa/views/torrents.py b/nyaa/views/torrents.py index 2234cf3..500491e 100644 --- a/nyaa/views/torrents.py +++ b/nyaa/views/torrents.py @@ -114,27 +114,16 @@ def edit_torrent(torrent_id): torrent.remake = form.is_remake.data torrent.complete = form.is_complete.data torrent.anonymous = form.is_anonymous.data - if editor.is_trusted: torrent.trusted = form.is_trusted.data - deleted_changed = torrent.deleted != form.is_deleted.data - if editor.is_moderator: - torrent.deleted = form.is_deleted.data - - url = flask.url_for('torrents.view', torrent_id=torrent.id) - if deleted_changed and editor.is_moderator: - log = "Torrent [#{0}]({1}) marked as {2}".format( - torrent.id, url, "deleted" if torrent.deleted else "undeleted") - adminlog = models.AdminLog(log=log, admin_id=editor.id) - db.session.add(adminlog) - db.session.commit() flask.flash(flask.Markup( 'Torrent has been successfully edited! Changes might take a few minutes to show up.'), 'success') + url = flask.url_for('torrents.view', torrent_id=torrent.id) return flask.redirect(url) elif flask.request.method == 'POST' and delete_form.validate() and \ (not ban_form or ban_form.validate()): @@ -151,9 +140,7 @@ def edit_torrent(torrent_id): form.is_remake.data = torrent.remake form.is_complete.data = torrent.complete form.is_anonymous.data = torrent.anonymous - form.is_trusted.data = torrent.trusted - form.is_deleted.data = torrent.deleted ipbanned = None if editor.is_moderator: