Permalink
Browse files

Add maximum length for device name

  • Loading branch information...
ibot3 committed Oct 15, 2018
1 parent 1613135 commit c45ad43b657683c126ca9e5f865769dbdd7f80ed
Showing with 2 additions and 2 deletions.
  1. +2 −2 sipa/forms.py
@@ -9,7 +9,7 @@
from wtforms import (BooleanField, HiddenField, PasswordField, SelectField,
StringField, TextAreaField, RadioField, IntegerField, DateField)
from wtforms.validators import (AnyOf, DataRequired, Email, EqualTo,
MacAddress, Regexp, ValidationError, NumberRange, Optional)
MacAddress, Regexp, ValidationError, NumberRange, Optional, Length)

from sipa.backends.extension import backends

@@ -200,7 +200,7 @@ class ActivateNetworkAccessForm(FlaskForm):
description="YYYY-MM-DD (z.B. 1995-10-23)")
host_name = StringField(label=lazy_gettext("Gerätename (Optional)"),
validators=[Regexp(regex="^[a-zA-Z0-9 ]+", message=u"Gerätename ist ungültig"),
Optional()],
Optional(), Length(-1, 30), lazy_gettext("Gerätename zu lang")],
description="TL-WR841N, MacBook, FritzBox, PC, Laptop, o.Ä.")


0 comments on commit c45ad43

Please sign in to comment.