Skip to content

Commit

Permalink
feat: add char min-length of 20 to text answers in feedback form
Browse files Browse the repository at this point in the history
  • Loading branch information
hanlun0804 authored and henrikhorluck committed Oct 9, 2024
1 parent ead073c commit 7e3e849
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/feedback/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from crispy_forms.helper import FormHelper
from django import forms
from django.core import validators

from apps.feedback.models import (
RATING_CHOICES,
Expand Down Expand Up @@ -46,7 +47,8 @@ class Meta:

class TextAnswerForm(AnswerForm):
answer = forms.CharField(
widget=forms.Textarea(attrs={"class": "form-control", "type": "text"})
widget=forms.Textarea(attrs={"class": "form-control", "type": "text"}),
validators=[validators.MinLengthValidator(20)],
)

class Meta:
Expand Down

0 comments on commit 7e3e849

Please sign in to comment.