Skip to content

stages/email: fix ungrammatical expiry time in password reset templates (cherry-pick #22758 to version-2026.5) - #23952

Merged
BeryJu merged 1 commit into
version-2026.5from
cherry-pick/22758-to-version-2026.5
Jul 13, 2026
Merged

BeryJu merged 1 commit into
version-2026.5from
cherry-pick/22758-to-version-2026.5

Conversation

@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

Cherry-pick of #22758 to version-2026.5 branch.

Original PR: #22758
Original Author: @lwillek
Cherry-picked commit: bc65b25

…es (#22758)

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

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 #22757

* fix other templates too

Signed-off-by: Jens Langhammer <[email protected]>

* Revert "fix other templates too"

This reverts commit d069784.

The original fix replaces naturaltime with timeuntil in the
password reset templates, where the value is interpolated into the
sentence "The above link is valid for ...". However, the reverted commit
also changed the invitation templates, where the phrasing is different:

  "This invitation expires {{ expires }}."

In this context, naturaltime is correct and timeuntil would produce
awkward output. The fix only applies to the password reset templates;
the invitation templates should remain unchanged.

* fix template template

Signed-off-by: Jens Langhammer <[email protected]>

* fixup

Signed-off-by: Jens Langhammer <[email protected]>

---------

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens Langhammer <[email protected]>
Co-authored-by: Connor Peshek <[email protected]>
@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit c390c9e
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a54e70045c5ff000805da55
😎 Deploy Preview https://deploy-preview-23952--authentik-integrations.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.

@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit c390c9e
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a54e7004ab7f90008c05a4f
😎 Deploy Preview https://deploy-preview-23952--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.

@codecov

codecov Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3599 1 3598 1
View the top 1 failed test(s) by shortest run time
tests.e2e.test_endpoints_flow.TestEndpointsFlow::test_login
Stack Traces | 74.5s run time
self = <unittest.case._Outcome object at 0x7f8aa8a07cb0>
test_case = <tests.e2e.test_endpoints_flow.TestEndpointsFlow testMethod=test_login>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.6........./x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_endpoints_flow.TestEndpointsFlow testMethod=test_login>
result = <TestCaseFunction test_login>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
>                   self._callSetUp()

.../hostedtoolcache/Python/3.14.6........./x64/lib/python3.14/unittest/case.py:665: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_endpoints_flow.TestEndpointsFlow testMethod=test_login>

    def _callSetUp(self):
>       self.setUp()

.../hostedtoolcache/Python/3.14.6........./x64/lib/python3.14/unittest/case.py:612: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<tests.e2e.test_endpoints_flow.TestEndpointsFlow testMethod=test_login>,)
kwargs = {}, config = <AuthentikCryptoConfig: authentik_crypto>

    @wraps(func)
    def wrapper(*args, **kwargs):
        config = apps.get_app_config(app_name)
        if isinstance(config, ManagedAppConfig):
            config._on_startup_callback(None)
>       return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^

.../blueprints/tests/__init__.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_endpoints_flow.TestEndpointsFlow testMethod=test_login>

    @reconcile_app("authentik_crypto")
    def setUp(self):
>       super().setUp()

tests/e2e/test_endpoints_flow.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_endpoints_flow.TestEndpointsFlow testMethod=test_login>

    def setUp(self):
        super().setUp()
>       self.driver = self._get_driver()
                      ^^^^^^^^^^^^^^^^^^

tests/selenium.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.e2e.test_endpoints_flow.TestEndpointsFlow testMethod=test_login>

    def _get_driver(self) -> WebDriver:
        count = 0
        opts = webdriver.ChromeOptions()
        opts.accept_insecure_certs = True
        opts.add_argument("--disable-search-engine-choice-screen")
        opts.add_extension(self._get_chrome_extension())
        # This breaks selenium when running remotely...?
        # opts.set_capability("goog:loggingPrefs", {"browser": "ALL"})
        opts.add_experimental_option(
            "prefs",
            {
                "profile.password_manager_leak_detection": False,
            },
        )
        while count < RETRIES:
            try:
                driver = webdriver.Remote(
                    command_executor="http://localhost:4444/wd/hub",
                    options=opts,
                )
                driver.maximize_window()
                return driver
            except WebDriverException as exc:
                self.logger.warning("Failed to setup webdriver", exc=exc)
                count += 1
>       raise ValueError(f"Webdriver failed after {RETRIES}.")
E       ValueError: Webdriver failed after 3.

tests/selenium.py:72: ValueError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@BeryJu
BeryJu merged commit 05358b6 into version-2026.5 Jul 13, 2026
150 of 166 checks passed
@BeryJu
BeryJu deleted the cherry-pick/22758-to-version-2026.5 branch July 13, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants