Skip to content

Commit 050e7c9

Browse files
Fix Finding_Group name truncated to 255 chars to prevent DataError
Finding_Group.name is varchar(255), but auto-group names built from long component names, file paths, or titles could exceed that limit, causing a DataError on import. Truncate the name in get_or_create to stay within the database column length. Fixes #14367
1 parent a49f1b4 commit 050e7c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dojo/finding/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def add_findings_to_auto_group(name, findings, group_by, *, create_finding_group
362362

363363
if create_finding_groups_for_all_findings or len(findings) > 1:
364364
# Only create a finding group if we have more than one finding for a given finding group, unless configured otherwise
365-
finding_group, created = Finding_Group.objects.get_or_create(test=test, creator=creator, name=name)
365+
finding_group, created = Finding_Group.objects.get_or_create(test=test, creator=creator, name=name[:255])
366366
if created:
367367
logger.debug("Created Finding Group %d:%s for test %d:%s", finding_group.id, finding_group, test.id, test)
368368
# See if we have old findings in the same test that were created without a finding group

0 commit comments

Comments
 (0)