mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-16 08:19:05 +00:00
DB CHANGE: Add uploader ip address to torrent column and show on torrent view page for superadmins.
Added migration script!: remove sukebei_ lines if your local db does not have those. Show users ip address on user page for superadmins. Rename Admin to Moderator internally. Moderators can now change user level to trusted. Superadmins can make users moderator. Improve changing user level.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import flask
|
||||
from nyaa import app, db
|
||||
from nyaa import models, forms
|
||||
from nyaa import bencode, utils
|
||||
@@ -8,6 +9,7 @@ import json
|
||||
from werkzeug import secure_filename
|
||||
from collections import OrderedDict
|
||||
from orderedset import OrderedSet
|
||||
from ipaddress import ip_address
|
||||
|
||||
|
||||
def _replace_utf8_values(dict_or_list):
|
||||
@@ -53,7 +55,8 @@ def handle_torrent_upload(upload_form, uploading_user=None, fromAPI=False):
|
||||
description=description,
|
||||
encoding=torrent_encoding,
|
||||
filesize=torrent_filesize,
|
||||
user=uploading_user)
|
||||
user=uploading_user,
|
||||
uploader_ip=ip_address(flask.request.remote_addr).packed)
|
||||
|
||||
# Store bencoded info_dict
|
||||
torrent.info = models.TorrentInfo(info_dict=torrent_data.bencoded_info_dict)
|
||||
|
||||
Reference in New Issue
Block a user