diff --git a/nyaa/views/torrents.py b/nyaa/views/torrents.py index 1780eb4..b8c6c3e 100644 --- a/nyaa/views/torrents.py +++ b/nyaa/views/torrents.py @@ -203,6 +203,8 @@ def _delete_torrent(torrent, form, banform): torrent.deleted = True action = 'deleted and banned' db.session.add(models.TrackerApi(torrent.info_hash, 'remove')) + torrent.stats.seed_count = 0 + torrent.stats.leech_count = 0 db.session.add(torrent) elif form.undelete.data and torrent.deleted: @@ -354,7 +356,7 @@ def edit_comment(torrent_id, comment_id): form = forms.CommentForm(flask.request.form) if not form.validate(): - error_str = ' '.join(form.errors['comment']) + error_str = ' '.join(form.errors) flask.abort(flask.make_response(flask.jsonify({'error': error_str}), 400)) comment.text = form.comment.data diff --git a/nyaa/views/users.py b/nyaa/views/users.py index 229df90..52a67d6 100644 --- a/nyaa/views/users.py +++ b/nyaa/views/users.py @@ -171,6 +171,7 @@ def view_user(user_name): rss_filter=rss_query_string, admin_form=admin_form, ban_form=ban_form, + nuke_form=nuke_form, bans=bans, ipbanned=ipbanned) # Similar logic as home page @@ -270,6 +271,8 @@ def nuke_user_torrents(user_name): for t in chain(user.nyaa_torrents, user.sukebei_torrents): t.deleted = True t.banned = True + t.stats.seed_count = 0 + t.stats.leech_count = 0 db.session.add(t) if isinstance(t, models.NyaaTorrent): db.session.add(models.NyaaTrackerApi(t.info_hash, 'remove'))