Skip to content

Commit

Permalink
fix(Risk_Acceptance): Remove redundancy in strings of Treatments (#10361
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kiblik authored Jun 21, 2024
1 parent aafeaf2 commit 9dcb7f9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3614,22 +3614,22 @@ class Risk_Acceptance(models.Model):
TREATMENT_FIX = 'F'
TREATMENT_TRANSFER = 'T'

TREATMENT_CHOICES = [
(TREATMENT_ACCEPT, 'Accept (The risk is acknowledged, yet remains)'),
(TREATMENT_AVOID, 'Avoid (Do not engage with whatever creates the risk)'),
(TREATMENT_MITIGATE, 'Mitigate (The risk still exists, yet compensating controls make it less of a threat)'),
(TREATMENT_FIX, 'Fix (The risk is eradicated)'),
(TREATMENT_TRANSFER, 'Transfer (The risk is transferred to a 3rd party)'),
]

TREATMENT_TRANSLATIONS = {
'A': 'Accept (The risk is acknowledged, yet remains)',
'V': 'Avoid (Do not engage with whatever creates the risk)',
'M': 'Mitigate (The risk still exists, yet compensating controls make it less of a threat)',
'F': 'Fix (The risk is eradicated)',
'T': 'Transfer (The risk is transferred to a 3rd party)',
TREATMENT_ACCEPT: _('Accept (The risk is acknowledged, yet remains)'),
TREATMENT_AVOID: _('Avoid (Do not engage with whatever creates the risk)'),
TREATMENT_MITIGATE: _('Mitigate (The risk still exists, yet compensating controls make it less of a threat)'),
TREATMENT_FIX: _('Fix (The risk is eradicated)'),
TREATMENT_TRANSFER: _('Transfer (The risk is transferred to a 3rd party)'),
}

TREATMENT_CHOICES = [
(TREATMENT_ACCEPT, TREATMENT_TRANSLATIONS[TREATMENT_ACCEPT]),
(TREATMENT_AVOID, TREATMENT_TRANSLATIONS[TREATMENT_AVOID]),
(TREATMENT_MITIGATE, TREATMENT_TRANSLATIONS[TREATMENT_MITIGATE]),
(TREATMENT_FIX, TREATMENT_TRANSLATIONS[TREATMENT_FIX]),
(TREATMENT_TRANSFER, TREATMENT_TRANSLATIONS[TREATMENT_TRANSFER]),
]

name = models.CharField(max_length=300, null=False, blank=False, help_text=_("Descriptive name which in the future may also be used to group risk acceptances together across engagements and products"))

accepted_findings = models.ManyToManyField(Finding)
Expand Down

0 comments on commit 9dcb7f9

Please sign in to comment.