@@ -20,7 +20,7 @@ from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, TextAreaField, SubmitField
|
||||
from wtforms.validators import InputRequired, Length, Optional, Regexp
|
||||
|
||||
from app.utils import rank_required
|
||||
from app.utils import rank_required, normalize_line_endings
|
||||
from . import bp
|
||||
from app.models import UserRank, ContentWarning, db
|
||||
|
||||
@@ -33,7 +33,7 @@ def warning_list():
|
||||
|
||||
class WarningForm(FlaskForm):
|
||||
title = StringField("Title", [InputRequired(), Length(3, 100)])
|
||||
description = TextAreaField("Description", [Optional(), Length(0, 500)])
|
||||
description = TextAreaField("Description", [Optional(), Length(0, 500)], filters=[normalize_line_endings])
|
||||
name = StringField("Name", [Optional(), Length(1, 20),
|
||||
Regexp("^[a-z0-9_]", 0, "Lower case letters (a-z), digits (0-9), and underscores (_) only")])
|
||||
submit = SubmitField("Save")
|
||||
|
||||
Reference in New Issue
Block a user