Repository navigation
🐛(backend) keep the case of titles and names in email subjects - #2794
Conversation
|
No actionable comments were generated in the recent review. WalkthroughThree email methods now use Django’s Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Suggested reviewers: Merge Risk:
|
str.capitalize() lowercased every character after the first, so document titles and user names in email subjects lost their case. Use django's capfirst to only uppercase the first letter. Signed-off-by: Roee Sivan <[email protected]>
Put POSTHOG-related variables together
543a1ad to
3799ef6
Compare
Purpose
Fixes #2792. Email subjects went through
str.capitalize(), which lowercasesevery character after the first, so names and document titles lost their case:
Anne Martin mentioned you in "Budget 2026"was sent asAnne martin mentioned you in "budget 2026".Proposal
capfirstinstead ofstr.capitalize()in the threesend_emailmethods (User,UserReconciliationCsvImport,Document):it only uppercases the first letter, which still matters for subjects
starting with a lowercase user name or passed in by the caller.
email.subject.lower(), whichhid the bug. They now compare the exact subject.
test_models_documents__email_invitation__success_empty_title, whichasserted the lowercased
Test sender.en-usintest_api_documents_mention_thread, like the other mention test does:the factory picks a random language, and
fr-fr/nl-nltranslate thissubject, so the test failed about 2 runs in 5.
External contributions
Thank you for your contribution! 🎉
Please ensure the following items are checked before submitting your pull request:
General requirements
Skip the checkbox below 👇 if you're fixing an issue or adding documentation
CI requirements
git commit --signoff(DCO compliance)git commit -S)<gitmoji>(type) title description## [Unreleased]section (if noticeable change)AI requirements
Skip the checkboxes below 👇 If you didn't use AI for your contribution