mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2025-01-25 00:15:12 +00:00
Remove deprecated torrent delete code.
This commit is contained in:
parent
d7b413e4d7
commit
8de2663fc2
|
@ -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')
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue