
from wtforms import TextAreaField
from wtforms.validators import InputRequired

from ...util.l10n import LocalizedForm


class CancelForm(LocalizedForm):
    reason = TextAreaField('Begründung', validators=[InputRequired()])


from wtforms import TextAreaField
from wtforms.validators import InputRequired, Length

from ...util.l10n import LocalizedForm


class CancelForm(LocalizedForm):
    reason = TextAreaField('Begründung', validators=[InputRequired(), Length(max=200)])

Validate length of cancelation reason supplied via form
Validate length of cancelation reason supplied via form

  
  from wtforms import TextAreaField
- from wtforms.validators import InputRequired
+ from wtforms.validators import InputRequired, Length
  
  from ...util.l10n import LocalizedForm
  
  
  class CancelForm(LocalizedForm):
-     reason = TextAreaField('Begründung', validators=[InputRequired()])
+     reason = TextAreaField('Begründung', validators=[InputRequired(), Length(max=200)])
  
Validate length of cancelation reason supplied via form
## Code Before:

from wtforms import TextAreaField
from wtforms.validators import InputRequired

from ...util.l10n import LocalizedForm


class CancelForm(LocalizedForm):
    reason = TextAreaField('Begründung', validators=[InputRequired()])

## Instruction:
Validate length of cancelation reason supplied via form
## Code After:

from wtforms import TextAreaField
from wtforms.validators import InputRequired, Length

from ...util.l10n import LocalizedForm


class CancelForm(LocalizedForm):
    reason = TextAreaField('Begründung', validators=[InputRequired(), Length(max=200)])
