Skip to content

Commit

Permalink
Remove EditCaseForm and use NewCaseForm instead, Refs #708, #812
Browse files Browse the repository at this point in the history
the two forms are identical so use only 1 of them.

CC @asankov
  • Loading branch information
atodorov committed Feb 22, 2019
1 parent 3b0ecaf commit acfd2a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions tcms/testcases/forms.py
Expand Up @@ -121,10 +121,6 @@ def clean_case_status(self):
return self.cleaned_data['case_status']


class EditCaseForm(BaseCaseForm):
pass


class CaseNotifyForm(forms.Form):
author = forms.BooleanField(required=False, initial=True)
default_tester_of_case = forms.BooleanField(required=False, initial=True)
Expand Down
7 changes: 3 additions & 4 deletions tcms/testcases/views.py
Expand Up @@ -26,8 +26,7 @@
from tcms.testruns.models import TestCaseRun
from tcms.testruns.models import TestCaseRunStatus
from tcms.testcases.forms import NewCaseForm, \
SearchCaseForm, EditCaseForm, CaseNotifyForm, \
CloneCaseForm
SearchCaseForm, CaseNotifyForm, CloneCaseForm
from tcms.testplans.forms import SearchPlanForm
from tcms.testcases.fields import MultipleEmailField

Expand Down Expand Up @@ -683,7 +682,7 @@ def edit(request, case_id):
from_plan = "?from_plan=%d" % test_plan.pk

if request.method == "POST":
form = EditCaseForm(request.POST)
form = NewCaseForm(request.POST)
if request.POST.get('product'):
form.populate(product_id=request.POST['product'])
elif test_plan:
Expand Down Expand Up @@ -723,7 +722,7 @@ def edit(request, case_id):
if test_case.default_tester_id:
default_tester = test_case.default_tester.email

form = EditCaseForm(initial={
form = NewCaseForm(initial={
'summary': test_case.summary,
'default_tester': default_tester,
'requirement': test_case.requirement,
Expand Down

0 comments on commit acfd2a6

Please sign in to comment.