mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-16 00:09:05 +00:00
Usage of WTForms for report action
This commit is contained in:
@@ -6,7 +6,7 @@ import os
|
||||
import re
|
||||
from flask_wtf import FlaskForm
|
||||
from flask_wtf.file import FileField, FileRequired
|
||||
from wtforms import StringField, PasswordField, BooleanField, TextAreaField, SelectField
|
||||
from wtforms import StringField, PasswordField, BooleanField, TextAreaField, SelectField, HiddenField
|
||||
from wtforms.validators import DataRequired, Optional, Email, Length, EqualTo, ValidationError
|
||||
from wtforms.validators import Regexp
|
||||
|
||||
@@ -287,6 +287,12 @@ class ReportForm(FlaskForm):
|
||||
])
|
||||
|
||||
|
||||
class ReportActionForm(FlaskForm):
|
||||
action = SelectField(choices=[('close', 'Close'), ('hide', 'Hide'), ('delete', 'Delete')])
|
||||
torrent = HiddenField()
|
||||
report = HiddenField()
|
||||
|
||||
|
||||
def _validate_trackers(torrent_dict, tracker_to_check_for=None):
|
||||
announce = torrent_dict.get('announce')
|
||||
announce_string = _validate_bytes(announce, 'announce', 'utf-8')
|
||||
|
||||
Reference in New Issue
Block a user