Fix email template rendering for product_type_added notification#14220
Merged
rossops merged 2 commits intoDefectDojo:devfrom Feb 9, 2026
Merged
Fix email template rendering for product_type_added notification#14220rossops merged 2 commits intoDefectDojo:devfrom
rossops merged 2 commits intoDefectDojo:devfrom
Conversation
Comment on lines
-27
to
-37
| <p> | ||
| {% url 'notifications' as notification_url %} | ||
| {% trans "You can manage your notification settings here" %}: <a href="{{ notification_url|full_url }}">{{ notification_url|full_url }}</a> | ||
| </p> | ||
| {% if system_settings.disclaimer_notifications and system_settings.disclaimer_notifications.strip %} | ||
| <br/> | ||
| <div style="background-color:#DADCE2; border:1px #003333; padding:.8em; "> | ||
| <span style="font-size:16pt; font-family: 'Cambria','times new roman','garamond',serif; color:#ff0000;">{% trans "Disclaimer" %}</span><br/> | ||
| <p style="font-size:11pt; line-height:10pt; font-family: 'Cambria','times roman',serif;">{{ system_settings.disclaimer_notifications }}</p> | ||
| </div> | ||
| {% endif %} |
Member
There was a problem hiding this comment.
Is there a reason why you're leaving out this part?
Author
There was a problem hiding this comment.
Thanks for flagging this. There was no specific reason to remove that section, the intent of this PR is only to fix the template rendering issue.
I’ll restore that part to avoid introducing unrelated changes.
Member
|
Thanks for the PR, please see my comment. |
Maffooch
approved these changes
Feb 5, 2026
blakeaowens
approved these changes
Feb 6, 2026
rossops
approved these changes
Feb 9, 2026
fopina
pushed a commit
to fopina/django-DefectDojo
that referenced
this pull request
Feb 16, 2026
…dded-email-template Fix email template rendering for product_type_added notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR fixes a Django template rendering error in the
product_type_addedemail notification.The original template used an invalid
blocktranslatesyntax by:withkeyword, andurl|full_url) directly into theblocktranslatetag.This caused email notifications to fail at render time with the following error:
The issue does not affect DefectDojo service startup or application availability.
It only impacts email delivery when a
product_type_addednotification is triggered.The fix ensures Django-compliant usage of
blocktranslateby resolving the URL outside the tag and passing only valid variables.Test results
product_type_addednotification.No automated tests were added, as this change affects a Django email template and is covered via manual validation.
Documentation
No documentation changes are required.
This PR fixes a template-level bug without introducing new functionality or configuration changes.
Checklist
bugfixbranch.bugfixbranch.Extra information
This fix restores proper email notification behavior for product type creation events and aligns the template with Django i18n best practices.