Skip to content

Commit 0b53add

Browse files
authored
Merge pull request #13228 from DefectDojo/duplicate-tag-patch
Tags: Remove duplicates in edit forms
2 parents 1d1b84e + 9ca1c58 commit 0b53add

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

dojo/forms.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ class ProductForm(forms.ModelForm):
342342
product_manager = forms.ModelChoiceField(queryset=Dojo_User.objects.exclude(is_active=False).order_by("first_name", "last_name"), required=False)
343343
technical_contact = forms.ModelChoiceField(queryset=Dojo_User.objects.exclude(is_active=False).order_by("first_name", "last_name"), required=False)
344344
team_manager = forms.ModelChoiceField(queryset=Dojo_User.objects.exclude(is_active=False).order_by("first_name", "last_name"), required=False)
345+
tags = TagField(
346+
required=False,
347+
help_text="Add tags that help describe this product. Choose from the list or add new tags. Press Enter key to add.",
348+
)
345349

346350
def __init__(self, *args, **kwargs):
347351
super().__init__(*args, **kwargs)
@@ -1013,6 +1017,10 @@ class EngForm(forms.ModelForm):
10131017
queryset=None,
10141018
required=True, label="Testing Lead")
10151019
test_strategy = forms.URLField(required=False, label="Test Strategy URL")
1020+
tags = TagField(
1021+
required=False,
1022+
help_text="Add tags that help describe this engagement. Choose from the list or add new tags. Press Enter key to add.",
1023+
)
10161024

10171025
def __init__(self, *args, **kwargs):
10181026
cicd = False
@@ -1092,10 +1100,13 @@ class TestForm(forms.ModelForm):
10921100
attrs={"class": "datepicker", "autocomplete": "off"}))
10931101
target_end = forms.DateTimeField(widget=forms.TextInput(
10941102
attrs={"class": "datepicker", "autocomplete": "off"}))
1095-
10961103
lead = forms.ModelChoiceField(
10971104
queryset=None,
10981105
required=False, label="Testing Lead")
1106+
tags = TagField(
1107+
required=False,
1108+
help_text="Add tags that help describe this test. Choose from the list or add new tags. Press Enter key to add.",
1109+
)
10991110

11001111
def __init__(self, *args, **kwargs):
11011112
obj = None
@@ -1452,6 +1463,10 @@ class FindingForm(forms.ModelForm):
14521463
choices=EFFORT_FOR_FIXING_CHOICES,
14531464
error_messages={
14541465
"invalid_choice": EFFORT_FOR_FIXING_INVALID_CHOICE})
1466+
tags = TagField(
1467+
required=False,
1468+
help_text="Add tags that help describe this finding. Choose from the list or add new tags. Press Enter key to add.",
1469+
)
14551470

14561471
# the only reliable way without hacking internal fields to get predicatble ordering is to make it explicit
14571472
field_order = ("title", "group", "date", "sla_start_date", "sla_expiration_date", "cwe", "vulnerability_ids", "severity", "cvss_info", "cvssv3",
@@ -1723,6 +1738,11 @@ class Meta:
17231738

17241739

17251740
class EditEndpointForm(forms.ModelForm):
1741+
tags = TagField(
1742+
required=False,
1743+
help_text="Add tags that help describe this endpoint. Choose from the list or add new tags. Press Enter key to add.",
1744+
)
1745+
17261746
class Meta:
17271747
model = Endpoint
17281748
exclude = ["product", "inherited_tags"]

0 commit comments

Comments
 (0)