Skip to content

Commit

Permalink
Make comments optional. Fixes #77
Browse files Browse the repository at this point in the history
when updating a case-run status comments are optional. However the
form HTML was displaying required="" and the validation error
reported in Issue #77 is generated on the browser side.

This commit explicitly sets the required attribute to False!
  • Loading branch information
atodorov committed Nov 2, 2017
1 parent 73607cf commit 08491f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tcms/core/contrib/comments/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class SimpleForm(CommentDetailsForm):
label=_('Comment'),
widget=forms.Textarea,
max_length=COMMENT_MAX_LENGTH,
required=False,
)

def clean_timestamp(self):
Expand Down
2 changes: 1 addition & 1 deletion tcms/testcases/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_user_in_default_group_sees_comments(self):

self.assertContains(
response,
'<textarea name="comment" cols="40" required id="id_comment" maxlength="10000" rows="10">\n</textarea>',
'<textarea name="comment" cols="40" id="id_comment" maxlength="10000" rows="10">\n</textarea>',
html=True)

for status in TestCaseRunStatus.objects.all():
Expand Down

0 comments on commit 08491f3

Please sign in to comment.