Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Risk_Acceptance): Remove redundancy in strings of Treatments #10361

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading