Fix URL encoding for community names in notification links #155
Open
xenacode-art wants to merge 12 commits intom2b3:testfrom
Open
Fix URL encoding for community names in notification links #155xenacode-art wants to merge 12 commits intom2b3:testfrom
xenacode-art wants to merge 12 commits intom2b3:testfrom
Conversation
Sync Alphatest with Test
Sync Main with AlphaTest
Sync test with alphatest
Sync main with Alphatest
Sync AlphaTest with Test
Sync Main with Alphatest
change MAX_COMMUNITIES_PER_USER to 40
change MAX_COMMUNITIES_PER_USER to 40
Community names containing special characters (e.g. '+', spaces) were being inserted raw into notification link paths, causing 404s when users clicked through. Apply urllib.parse.quote(..., safe='') to all in-app notification links that include the community name in the path. Fixes m2b3#119
Collaborator
|
@xenacode-art There have been couple of changes in the test branch regarding Notifications. Would request you to sync your changes. Before raising a new PR, please check again if this issue is re-occurring on https://test.scicommons.org/. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #119
Problem I noticed
In-app notification
linkfields were building URL paths using rawcommunity.namevalues. Community names containing special characterssuch as
+or spaces produced malformed paths — e.g./community/GSoC+2026/requests— which browsers misinterpret,causing 404s when users click through from their notification panel.
Fix I Implemented
Applied
urllib.parse.quote(community.name, safe='')to everynotification link that embeds a community name in the path. This
matches the encoding already used in
send_emails.pyfor email links.Files changed:
communities/api_join.py— join request received + approved notificationscommunities/articles_api.py— article submitted notificationarticles/api.py— article submitted notification (community context)Testing