This is an automated email from the ASF dual-hosted git repository.
gcruz pushed a commit to branch gc/8446
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/gc/8446 by this push:
new 7a2d9b6c3 fixup! [#8446] user links inside pages link directly to
profile
7a2d9b6c3 is described below
commit 7a2d9b6c3580556b880bc17f07496c8bbda86f66
Author: Guillermo Cruz <[email protected]>
AuthorDate: Fri Jul 8 12:52:49 2022 -0600
fixup! [#8446] user links inside pages link directly to profile
---
ForgeActivity/forgeactivity/main.py | 3 ++-
ForgeActivity/forgeactivity/tests/functional/test_root.py | 2 +-
ForgeWiki/forgewiki/tests/functional/test_root.py | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/ForgeActivity/forgeactivity/main.py
b/ForgeActivity/forgeactivity/main.py
index a5b227373..d074f02fc 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -136,7 +136,6 @@ class ForgeActivityController(BaseController):
if not use_gravatar:
# force current user icon (overwrites previous gravatar urls
or defaults)
if t.actor.activity_url:
- t.actor.activity_url = f'{t.actor.activity_url}profile/'
t.actor.activity_extras.icon_url = icon_base +
t.actor.activity_url + 'user_icon'
# ideally ?{icon_timestamp} would be appended to URL for
cache-busting when CDN is used, but that
# value would only be available by querying and loading
the user-project
@@ -150,6 +149,8 @@ class ForgeActivityController(BaseController):
t.actor.activity_extras.icon_url = re.sub(r'([&?])d=[^&]*',
r'\1d={}'.format(default_avatar),
t.actor.activity_extras.icon_url)
+ t.actor.activity_url = f'{t.actor.activity_url}profile/'
+
should_noindex = any(name in noindex_tags for name in t.tags)
t.obj.noindex = should_noindex
t.target.noindex = should_noindex
diff --git a/ForgeActivity/forgeactivity/tests/functional/test_root.py
b/ForgeActivity/forgeactivity/tests/functional/test_root.py
index cdbf679af..2948e560b 100644
--- a/ForgeActivity/forgeactivity/tests/functional/test_root.py
+++ b/ForgeActivity/forgeactivity/tests/functional/test_root.py
@@ -101,7 +101,7 @@ class TestActivityController(TestController):
h1 = """\
<h1>
<img alt="Administrator 1" class="emboss x32 avatar"
src="/u/test-admin/user_icon" title="Administrator 1"/>
- <a href="/u/test-admin/">
+ <a href="/u/test-admin/profile/">
Administrator 1
</a>
posted
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py
b/ForgeWiki/forgewiki/tests/functional/test_root.py
index 698e0feb3..6c98b5ffc 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -830,7 +830,7 @@ class TestRootController(TestController):
def test_user_browse_page(self):
r = self.app.get('/wiki/browse_pages/')
- assert '<td><a href="/u/test-admin/"
class="user-mention">test-admin</a></td>' in r
+ assert '<td><a href="/u/test-admin/profile/"
class="user-mention">test-admin</a></td>' in r
def test_subscribe(self):
user = M.User.query.get(username='test-user')