You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by gc...@apache.org on 2026/02/19 20:14:10 UTC

(allura) branch gc/8595 updated: [#8595] added tests and fixed hide_email function

This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8595
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/gc/8595 by this push:
     new 9899b3737 [#8595] added tests and fixed hide_email function
9899b3737 is described below

commit 9899b37371bfab1870ab67f6a2efdc04b03ce4fb
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Wed Feb 18 12:02:53 2026 -0700

    [#8595] added tests and fixed hide_email function
---
 Allura/allura/lib/utils.py        | 1 +
 Allura/allura/tests/test_utils.py | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index 0c4f204ab..c2f3778b6 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -936,3 +936,4 @@ def hide_name(email_address):
         return ', '.join(emails)
     email = hide_name(email)
     email = hide(email)
+    return email
diff --git a/Allura/allura/tests/test_utils.py b/Allura/allura/tests/test_utils.py
index a47950d53..d7174a444 100644
--- a/Allura/allura/tests/test_utils.py
+++ b/Allura/allura/tests/test_utils.py
@@ -429,3 +429,9 @@ def test_join_paths_no_traversal(base, paths, expected: str | type[Exception]):
     else:
         with pytest.raises(expected):
             utils.join_paths_no_traversal(base, *paths)
+
+
+def test_hide_email():
+    assert utils.hide_email('foo@bar.com') == '<fo...@ba...>'
+    assert utils.hide_email('email@example.com') == '<em...@ex...>'
+    assert utils.hide_email('email@example') == '<em...@ex...>'
\ No newline at end of file