set max length for domain

This commit is contained in:
Son NK 2020-05-05 12:46:11 +02:00
parent 7c31d39919
commit 3eb904c882
2 changed files with 4 additions and 3 deletions

View File

@ -66,7 +66,7 @@
<h2 class="h4">New Domain</h2>
{{ new_custom_domain_form.domain(class="form-control", placeholder="my-domain.com") }}
{{ new_custom_domain_form.domain(class="form-control", placeholder="my-domain.com", maxlength=128) }}
{{ render_field_errors(new_custom_domain_form.domain) }}
<div class="small-text">Please use full path domain, for ex <em>my-subdomain.my-domain.com</em></div>

View File

@ -10,9 +10,10 @@ from app.extensions import db
from app.models import CustomDomain
# todo: add more validation
class NewCustomDomainForm(FlaskForm):
domain = StringField("domain", validators=[validators.DataRequired()])
domain = StringField(
"domain", validators=[validators.DataRequired(), validators.Length(max=128)]
)
@dashboard_bp.route("/custom_domain", methods=["GET", "POST"])