Skip to content

Commit 56eb50c

Browse files
update model help_text and verbose_name
1 parent 8eb26a9 commit 56eb50c

File tree

3 files changed

+40
-28
lines changed

3 files changed

+40
-28
lines changed
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 5.1.8 on 2025-07-06 07:25
1+
# Generated by Django 5.1.8 on 2025-07-08 17:21
22

33
import django.core.validators
44
import dojo.validators
@@ -7,19 +7,31 @@
77

88
class Migration(migrations.Migration):
99

10+
replaces = [('dojo', '0234_finding_cvssv4_finding_cvssv4_score'), ('dojo', '0235_alter_finding_cvssv3_score_alter_finding_cvssv4_and_more'), ('dojo', '0236_alter_finding_cvssv3_alter_finding_cvssv3_score_and_more')]
11+
1012
dependencies = [
1113
('dojo', '0233_remove_test_actual_time_remove_test_estimated_time'),
1214
]
1315

1416
operations = [
17+
migrations.AlterField(
18+
model_name='finding',
19+
name='cvssv3',
20+
field=models.TextField(help_text='Common Vulnerability Scoring System version 3 (CVSS3) score associated with this finding.', max_length=117, null=True, validators=[dojo.validators.cvss3_validator], verbose_name='CVSS3 Vector'),
21+
),
22+
migrations.AlterField(
23+
model_name='finding',
24+
name='cvssv3_score',
25+
field=models.FloatField(blank=True, help_text='Numerical CVSS3 score for the vulnerability. If the vector is given without a score, the score is calcaulated while saving the finding. The value must be between 0-10.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(10.0)], verbose_name='CVSS3 Score'),
26+
),
1527
migrations.AddField(
1628
model_name='finding',
1729
name='cvssv4',
18-
field=models.TextField(help_text='Common Vulnerability Scoring System version 4 (CVSSv4) score associated with this finding.', max_length=117, null=True, validators=[dojo.validators.cvss4_validator], verbose_name='CVSS v4 vector'),
30+
field=models.TextField(help_text='Common Vulnerability Scoring System version 4 (CVSS4) score associated with this finding.', max_length=255, null=True, validators=[dojo.validators.cvss4_validator], verbose_name='CVSS4 vector'),
1931
),
2032
migrations.AddField(
2133
model_name='finding',
2234
name='cvssv4_score',
23-
field=models.FloatField(blank=True, help_text='Numerical CVSSv4 score for the vulnerability. If the vector is given, the score is updated while saving the finding. The value must be between 0-10.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(10.0)], verbose_name='CVSSv4 score'),
35+
field=models.FloatField(blank=True, help_text='Numerical CVSS4 score for the vulnerability. If the vector is given without a score, the score is calcaulated while saving the finding. The value must be between 0-10.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(10.0)], verbose_name='CVSSv4 Score'),
2436
),
2537
]

dojo/forms.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,10 +1148,10 @@ class AddFindingForm(forms.ModelForm):
11481148
widget=forms.TextInput(attrs={"class": "datepicker", "autocomplete": "off"}))
11491149
cwe = forms.IntegerField(required=False)
11501150
vulnerability_ids = vulnerability_ids_field
1151-
cvssv3 = forms.CharField(label="CVSS3", max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1152-
cvssv3_score = forms.FloatField(label="CVSS3 Score", required=False, max_value=10.0, min_value=0.0)
1153-
cvssv4 = forms.CharField(label="CVSS4", max_length=255, required=False)
1154-
cvssv4_score = forms.FloatField(label="CVSS4 Score", required=False, max_value=10.0, min_value=0.0)
1151+
cvssv3 = forms.CharField(max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1152+
cvssv3_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
1153+
cvssv4 = forms.CharField(max_length=255, required=False)
1154+
cvssv4_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
11551155
description = forms.CharField(widget=forms.Textarea)
11561156
severity = forms.ChoiceField(
11571157
choices=SEVERITY_CHOICES,
@@ -1242,10 +1242,10 @@ class AdHocFindingForm(forms.ModelForm):
12421242
required=False,
12431243
disabled=True)
12441244

1245-
cvssv3 = forms.CharField(label="CVSS3", max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1246-
cvssv3_score = forms.FloatField(label="CVSS3 Score", required=False, max_value=10.0, min_value=0.0)
1247-
cvssv4 = forms.CharField(label="CVSS4", max_length=255, required=False)
1248-
cvssv4_score = forms.FloatField(label="CVSS4 Score", required=False, max_value=10.0, min_value=0.0)
1245+
cvssv3 = forms.CharField(max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1246+
cvssv3_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
1247+
cvssv4 = forms.CharField(max_length=255, required=False)
1248+
cvssv4_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
12491249
description = forms.CharField(widget=forms.Textarea)
12501250
severity = forms.ChoiceField(
12511251
choices=SEVERITY_CHOICES,
@@ -1334,10 +1334,10 @@ class PromoteFindingForm(forms.ModelForm):
13341334
required=False,
13351335
disabled=True)
13361336

1337-
cvssv3 = forms.CharField(label="CVSS3", max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1338-
cvssv3_score = forms.FloatField(label="CVSS3 Score", required=False, max_value=10.0, min_value=0.0)
1339-
cvssv4 = forms.CharField(label="CVSS4", max_length=255, required=False)
1340-
cvssv4_score = forms.FloatField(label="CVSS4 Score", required=False, max_value=10.0, min_value=0.0)
1337+
cvssv3 = forms.CharField(max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1338+
cvssv3_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
1339+
cvssv4 = forms.CharField(max_length=255, required=False)
1340+
cvssv4_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
13411341
description = forms.CharField(widget=forms.Textarea)
13421342
severity = forms.ChoiceField(
13431343
choices=SEVERITY_CHOICES,
@@ -1405,10 +1405,10 @@ class FindingForm(forms.ModelForm):
14051405
required=False,
14061406
disabled=True)
14071407

1408-
cvssv3 = forms.CharField(label="CVSS3", max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1409-
cvssv3_score = forms.FloatField(label="CVSS3 Score", required=False, max_value=10.0, min_value=0.0)
1410-
cvssv4 = forms.CharField(label="CVSS4", max_length=255, required=False)
1411-
cvssv4_score = forms.FloatField(label="CVSS4 Score", required=False, max_value=10.0, min_value=0.0)
1408+
cvssv3 = forms.CharField(max_length=117, required=False, widget=forms.TextInput(attrs={"class": "cvsscalculator", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false"}))
1409+
cvssv3_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
1410+
cvssv4 = forms.CharField(max_length=255, required=False)
1411+
cvssv4_score = forms.FloatField(required=False, max_value=10.0, min_value=0.0)
14121412

14131413
description = forms.CharField(widget=forms.Textarea)
14141414
severity = forms.ChoiceField(

dojo/models.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,23 +2348,23 @@ class Finding(models.Model):
23482348
cvssv3 = models.TextField(validators=[cvss3_validator],
23492349
max_length=117,
23502350
null=True,
2351-
verbose_name=_("CVSS v3 vector"),
2352-
help_text=_("Common Vulnerability Scoring System version 3 (CVSSv3) score associated with this finding."))
2351+
verbose_name=_("CVSS3 Vector"),
2352+
help_text=_("Common Vulnerability Scoring System version 3 (CVSS3) score associated with this finding."))
23532353
cvssv3_score = models.FloatField(null=True,
23542354
blank=True,
2355-
verbose_name=_("CVSSv3 score"),
2356-
help_text=_("Numerical CVSSv3 score for the vulnerability. If the vector is given, the score is updated while saving the finding. The value must be between 0-10."),
2355+
verbose_name=_("CVSS3 Score"),
2356+
help_text=_("Numerical CVSS3 score for the vulnerability. If the vector is given without a score, the score is calcaulated while saving the finding. The value must be between 0-10."),
23572357
validators=[MinValueValidator(0.0), MaxValueValidator(10.0)])
23582358

23592359
cvssv4 = models.TextField(validators=[cvss4_validator],
2360-
max_length=117,
2360+
max_length=255,
23612361
null=True,
2362-
verbose_name=_("CVSS v4 vector"),
2363-
help_text=_("Common Vulnerability Scoring System version 4 (CVSSv4) score associated with this finding."))
2362+
verbose_name=_("CVSS4 vector"),
2363+
help_text=_("Common Vulnerability Scoring System version 4 (CVSS4) score associated with this finding."))
23642364
cvssv4_score = models.FloatField(null=True,
23652365
blank=True,
2366-
verbose_name=_("CVSSv4 score"),
2367-
help_text=_("Numerical CVSSv4 score for the vulnerability. If the vector is given, the score is updated while saving the finding. The value must be between 0-10."),
2366+
verbose_name=_("CVSSv4 Score"),
2367+
help_text=_("Numerical CVSS4 score for the vulnerability. If the vector is given without a score, the score is calcaulated while saving the finding. The value must be between 0-10."),
23682368
validators=[MinValueValidator(0.0), MaxValueValidator(10.0)])
23692369

23702370
url = models.TextField(null=True,

0 commit comments

Comments
 (0)