Automatic Engagement Numbering (ENG-XXXX) #13853
Draft
+13,293
−13,134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #13592 (Work in Progress)
This PR implements automatic unique ID generation for Engagements. When a new engagement is created, the system assigns a sequential ID (e.g.,
ENG-0001,ENG-0002) and displays it in the UI.Changes Implemented
custom_engagement_idtoEngagementmodel.save()method to query the last ID and increment it.view_engagement.htmlto display the ID next to the header.Configuration
The format can be configured via environment variables or
local_settings.py:ENG-{id:03d}->ENG-001ENG-{id:04d}->ENG-0001ENG-{id}->ENG-1etc.
Test Results & Verification
makemigrationsandmigratesuccessfully.Pending Edge Case (Need Feedback)
I am currently debugging behavior related to deleted engagements.
ENG-0005), the queryEngagement.objects.last()might behave unexpectedly depending on how DefectDojo handles "Soft Deletes" vs "Hard Deletes."