diff --git a/source/app/business/cases.py b/source/app/business/cases.py index fe41d1386..58a8b65c3 100644 --- a/source/app/business/cases.py +++ b/source/app/business/cases.py @@ -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) diff --git a/source/app/models/cases.py b/source/app/models/cases.py index cb253b99b..329f569cd 100644 --- a/source/app/models/cases.py +++ b/source/app/models/cases.py @@ -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, @@ -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): """ diff --git a/source/app/schema/marshables.py b/source/app/schema/marshables.py index 94eb41190..e14a29210 100644 --- a/source/app/schema/marshables.py +++ b/source/app/schema/marshables.py @@ -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