Skip to content

stages/email: fix ungrammatical expiry time in password reset templates#22758

Open
lwillek wants to merge 1 commit into
goauthentik:mainfrom
lwillek:fix/password_reset_templates
Open

stages/email: fix ungrammatical expiry time in password reset templates#22758
lwillek wants to merge 1 commit into
goauthentik:mainfrom
lwillek:fix/password_reset_templates

Conversation

@lwillek
Copy link
Copy Markdown

@lwillek lwillek commented May 29, 2026

Details

Django's naturaltime filter outputs a prepositional phrase (e.g., "in 23 hours"). When embedded in the existing sentence "The above link is valid for {{ expires }}", the prepositions clash, producing ungrammatical output in English ("valid for in 23 hours") as well as in translations (e.g., German: "gültig für in 23 Stunden").

This PR replaces naturaltime with timeuntil in the default password reset email templates. timeuntil returns a bare duration string (e.g., "23 hours"), which fits correctly into the existing sentence structure across all locales.

Changes

  • authentik/stages/email/templates/email/password_reset.txt
  • authentik/stages/email/templates/email/password_reset.html

Related issues


This is my first contribution to authentik — please let me know if anything needs adjustment.

Django's naturaltime filter outputs a prepositional phrase like
"in 23 hours". When interpolated into the existing sentence
"The above link is valid for ...", the prepositions clash,
producing broken grammar in English and all localized languages.

Replace naturaltime with timeuntil in both the HTML and plain-text
password reset templates so the interpolated value is a bare
duration string.

Fixes goauthentik#22757
@lwillek lwillek requested a review from a team as a code owner May 29, 2026 12:19
@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 41fdbfa
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a1984534624b000085ebfea
😎 Deploy Preview https://deploy-preview-22758--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(email): password_reset templates use naturaltime filter causing ungrammatical output

1 participant