Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

Commit fd149df

Browse files
committed
fixed import and display issues for requirements field in testcases
1 parent 5816ef2 commit fd149df

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

blueprints/testcase_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def testcasevisibility(id):
2626
def testcaseclone(id):
2727
orig = TestCase.objects(id=id).first()
2828
newcase = TestCase()
29-
copy = ["name", "assessmentid", "objective", "actions", "rednotes", "mitreid", "tactic", "tools", "tags", "expectedprevention", "expectedalertcreation", "expectedincidentcreation", "expectedseverity" , "priorityurgency"]
29+
copy = ["name", "assessmentid", "objective", "requirements", "actions", "rednotes", "mitreid", "tactic", "tools", "tags", "expectedprevention", "expectedalertcreation", "expectedincidentcreation", "expectedseverity" , "priorityurgency"]
3030
for field in copy:
3131
newcase[field] = orig[field]
3232
newcase.name = orig["name"] + " (Copy)"

seeder.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def parseCustomTestcases ():
158158
expectedprevention = yml["expectedprevention"],
159159
expectedalertcreation = yml["expectedalertcreation"],
160160
priorityurgency = yml["priorityurgency"],
161-
expectedseverity = yml["expectedseverity"]
161+
expectedseverity = yml["expectedseverity"],
162+
requirements = yml["requirements"]
162163
).save()
163164

164165
def parseCustomKBs ():
@@ -273,4 +274,9 @@ def populateSecrets ():
273274
populateSecrets()
274275

275276
print("Preparing roles and initial admin")
276-
prepareRolesAndAdmin()
277+
prepareRolesAndAdmin()
278+
279+
else:
280+
281+
print("update testcasekb")
282+
parseCustomTestcaseKBs()

templates/testcase_red.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@
9898
<div class="col">
9999
<div class="input-group my-3 mt-0" id="red-objective">
100100
<span class="input-group-text px-1 text-danger"
101-
style="writing-mode: vertical-lr">Objective</span>
101+
style="writing-mode: vertical-lr">Rational</span>
102102
<textarea class="form-control" name="objective" id="objective"
103103
style="min-height: 5.5em"{% if current_user.has_role("Blue") %} disabled{% endif %}>{{ testcase.objective }}</textarea>
104104
</div>
105105
<div class="input-group my-3 mt-0" id="red-requirements">
106106
<span class="input-group-text px-1 text-danger"
107107
style="writing-mode: vertical-lr">Requirements</span>
108108
<textarea class="form-control" name="requirements" id="requirements"
109-
style="min-height: 8.0em"{% if current_user.has_role("Blue") %} disabled{% endif %}>{{ testcase.requirements }}</textarea>
109+
style="min-height: 9.0em"{% if current_user.has_role("Blue") %} disabled{% endif %}>{{ testcase.requirements }}</textarea>
110110
</div>
111111
<div class="input-group my-3" id="red-actions">
112112
<span class="input-group-text px-1 text-danger"

0 commit comments

Comments
 (0)