Description
Fix user_mentioned notifications silently failing when a user is
@mentioned in a Finding or Test note.
Root Cause
process_tag_notifications() passed Dojo_User objects as recipients
to create_notification(), but _process_recipients() filters using
user__username__in=kwargs["recipients"] which expects username strings.
The type mismatch caused the queryset to return zero results → zero
notifications delivered.
Change
One-line fix in process_tag_notifications(): return username strings
from the list comprehension instead of Dojo_User objects.
Testing
Verified manually via Django shell:
- Before fix:
create_notification(recipients=[Dojo_User object]) → 0 alerts
- After fix:
create_notification(recipients=["username"]) → 1 alert created
Tested on DefectDojo 2.58.4, Docker Compose deployment.
Description
Fix
user_mentionednotifications silently failing when a user is@mentioned in a Finding or Test note.
Root Cause
process_tag_notifications()passedDojo_Userobjects asrecipientsto
create_notification(), but_process_recipients()filters usinguser__username__in=kwargs["recipients"]which expects username strings.The type mismatch caused the queryset to return zero results → zero
notifications delivered.
Change
One-line fix in
process_tag_notifications(): return username stringsfrom the list comprehension instead of
Dojo_Userobjects.Testing
Verified manually via Django shell:
create_notification(recipients=[Dojo_User object])→ 0 alertscreate_notification(recipients=["username"])→ 1 alert createdTested on DefectDojo 2.58.4, Docker Compose deployment.