[Config change] Upload ratelimit for non-trusted uploaders (#384)

* Implement upload ratelimit for non-trusted uploaders

Users may upload X torrents in Y minutes after which they
will have to wait Z minutes between uploads.

* Show torrent period count when ratelimited

* Only ratelimit new accounts
This commit is contained in:
Anna-Maria Meriniemi
2017-10-10 04:41:18 +03:00
committed by Arylide
parent 37546354a7
commit de1fd2f1bc
8 changed files with 105 additions and 3 deletions

View File

@@ -323,6 +323,8 @@ class UploadForm(FlaskForm):
Length(max=10 * 1024, message='Description must be at most %(max)d characters long.')
])
ratelimit = HiddenField()
def validate_torrent_file(form, field):
# Decode and ensure data is bencoded data
try: