Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d36304dc
Commit
d36304dc
authored
Sep 05, 2017
by
Harry Rein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow social usernames to contain periods.
LEARNER-2453
parent
b31287e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
openedx/core/djangoapps/user_api/accounts/tests/test_utils.py
+1
-0
openedx/core/djangoapps/user_api/accounts/utils.py
+3
-2
No files found.
openedx/core/djangoapps/user_api/accounts/tests/test_utils.py
View file @
d36304dc
...
...
@@ -35,6 +35,7 @@ class UserAccountSettingsTest(TestCase):
(
'twitter'
,
'https://www.twitter.com/edX/123s'
,
None
,
False
),
(
'twitter'
,
'twitter.com/edX'
,
'https://www.twitter.com/edX'
,
True
),
(
'twitter'
,
'twitter.com/edX?foo=bar'
,
'https://www.twitter.com/edX'
,
True
),
(
'twitter'
,
'twitter.com/test.user'
,
'https://www.twitter.com/test.user'
,
True
),
(
'linkedin'
,
'www.linkedin.com/harryrein'
,
None
,
False
),
(
'linkedin'
,
'www.linkedin.com/in/harryrein-1234'
,
'https://www.linkedin.com/in/harryrein-1234'
,
True
),
(
'linkedin'
,
'www.evilwebsite.com/123?www.linkedin.com/edX'
,
None
,
False
),
...
...
openedx/core/djangoapps/user_api/accounts/utils.py
View file @
d36304dc
...
...
@@ -85,6 +85,7 @@ def _get_username_from_social_link(platform_name, new_social_link):
def
_is_valid_social_username
(
value
):
"""
Given a particular string, returns whether the string can be considered a safe username.
A safe username contains only hyphens, underscores or other alphanumerical characters.
This is a very liberal validation step, simply assuring forward slashes do not exist
in the username.
"""
return
bool
(
re
.
match
(
'^[a-zA-Z0-9_-]*$'
,
value
))
return
'/'
not
in
value
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment