Skip to content

Commit

Permalink
Merge pull request #653 from Vladimir-A/severity_id
Browse files Browse the repository at this point in the history
[IMP] added severity_id for creating cases
  • Loading branch information
whikernel authored Dec 9, 2024
2 parents 087906a + b17a20a commit bebb348
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/app/business/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def create(request_json):

case = _load(request_data)
case.owner_id = current_user.id
case.severity_id = 4
if not case.severity_id: case.severity_id = 4

if case_template_id and len(case_template_id) > 0:
case = case_template_pre_modifier(case, case_template_id)
Expand Down
6 changes: 4 additions & 2 deletions source/app/models/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def __init__(self,
user=None,
custom_attributes=None,
classification_id=None,
state_id=None
state_id=None,
severity_id=None
):
self.name = name[:200] if name else None,
self.soc_id = soc_id,
Expand All @@ -111,7 +112,8 @@ def __init__(self,
self.case_uuid = uuid.uuid4()
self.status_id = 0
self.classification_id = classification_id
self.state_id = state_id
self.state_id = state_id,
self.severity_id = severity_id

def save(self):
"""
Expand Down
1 change: 1 addition & 0 deletions source/app/schema/marshables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,7 @@ class CaseSchema(ma.SQLAlchemyAutoSchema):
initial_date: Optional[datetime.datetime] = auto_field('initial_date', required=False)
classification_id: Optional[int] = auto_field('classification_id', required=False, allow_none=True)
reviewer_id: Optional[int] = auto_field('reviewer_id', required=False, allow_none=True)
severity_id: Optional[int] = auto_field('severity_id', required=False, allow_none=True)

class Meta:
model = Cases
Expand Down

0 comments on commit bebb348

Please sign in to comment.