Adding report table, route and view.

This commit is contained in:
nyaazi
2017-05-19 20:03:47 +03:00
parent 375dcf15ef
commit 98fbe6efb1
4 changed files with 95 additions and 1 deletions

View File

@@ -278,6 +278,14 @@ class TorrentFileData(object):
# https://wiki.theory.org/BitTorrentSpecification#Metainfo_File_Structure
class ReportForm(FlaskForm):
reason = TextAreaField('Report reason', [
Length(min=3, max=255,
message='Report reason must be at least %(min)d characters long '
'and %(max)d at most.')
])
def _validate_trackers(torrent_dict, tracker_to_check_for=None):
announce = torrent_dict.get('announce')
announce_string = _validate_bytes(announce, 'announce', 'utf-8')