Add custom message for object_name length validation

This commit is contained in:
richard-dds 2019-08-13 13:58:36 -04:00
parent ac7de6b4d2
commit 6652d47104

View File

@ -71,7 +71,12 @@ class AttachmentForm(BaseForm):
Length(max=100, message="Filename may be no longer than 100 characters.")
],
)
object_name = HiddenField(id="attachment_object_name", validators=[Length(max=40)])
object_name = HiddenField(
id="attachment_object_name",
validators=[
Length(max=40, message="Object name may be no longer than 40 characters.")
],
)
accept = ".pdf,application/pdf"
def validate(self, *args, **kwargs):