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
38e787b6
Commit
38e787b6
authored
Oct 20, 2016
by
Felipe Montoya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quick fixes for users with unicode usernames.
This changes fix the bookmarks feature and image upload
parent
ba491a64
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
4 deletions
+5
-4
common/lib/xmodule/xmodule/vertical_block.py
+1
-1
openedx/core/djangoapps/bookmarks/models.py
+1
-1
openedx/core/djangoapps/bookmarks/serializers.py
+1
-1
openedx/core/djangoapps/user_api/accounts/image_helpers.py
+2
-1
No files found.
common/lib/xmodule/xmodule/vertical_block.py
View file @
38e787b6
...
@@ -70,7 +70,7 @@ class VerticalBlock(SequenceFields, XModuleFields, StudioEditableBlock, XmlParse
...
@@ -70,7 +70,7 @@ class VerticalBlock(SequenceFields, XModuleFields, StudioEditableBlock, XmlParse
'unit_title'
:
self
.
display_name_with_default
if
not
is_child_of_vertical
else
None
,
'unit_title'
:
self
.
display_name_with_default
if
not
is_child_of_vertical
else
None
,
'show_bookmark_button'
:
not
is_child_of_vertical
,
'show_bookmark_button'
:
not
is_child_of_vertical
,
'bookmarked'
:
child_context
[
'bookmarked'
],
'bookmarked'
:
child_context
[
'bookmarked'
],
'bookmark_id'
:
"{},{}"
.
format
(
child_context
[
'username'
],
unicode
(
self
.
location
))
'bookmark_id'
:
u
"{},{}"
.
format
(
child_context
[
'username'
],
unicode
(
self
.
location
))
}))
}))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/vertical_student_view.js'
))
fragment
.
add_javascript_url
(
self
.
runtime
.
local_resource_url
(
self
,
'public/js/vertical_student_view.js'
))
...
...
openedx/core/djangoapps/bookmarks/models.py
View file @
38e787b6
...
@@ -98,7 +98,7 @@ class Bookmark(TimeStampedModel):
...
@@ -98,7 +98,7 @@ class Bookmark(TimeStampedModel):
"""
"""
Return the resource id: {username,usage_id}.
Return the resource id: {username,usage_id}.
"""
"""
return
"{0},{1}"
.
format
(
self
.
user
.
username
,
self
.
usage_key
)
# pylint: disable=no-member
return
u
"{0},{1}"
.
format
(
self
.
user
.
username
,
self
.
usage_key
)
# pylint: disable=no-member
@property
@property
def
display_name
(
self
):
def
display_name
(
self
):
...
...
openedx/core/djangoapps/bookmarks/serializers.py
View file @
38e787b6
...
@@ -51,7 +51,7 @@ class BookmarkSerializer(serializers.ModelSerializer):
...
@@ -51,7 +51,7 @@ class BookmarkSerializer(serializers.ModelSerializer):
"""
"""
Return the REST resource id: {username,usage_id}.
Return the REST resource id: {username,usage_id}.
"""
"""
return
"{0},{1}"
.
format
(
bookmark
.
user
.
username
,
bookmark
.
usage_key
)
return
u
"{0},{1}"
.
format
(
bookmark
.
user
.
username
,
bookmark
.
usage_key
)
def
get_path
(
self
,
bookmark
):
def
get_path
(
self
,
bookmark
):
"""
"""
...
...
openedx/core/djangoapps/user_api/accounts/image_helpers.py
View file @
38e787b6
...
@@ -38,7 +38,8 @@ def _make_profile_image_name(username):
...
@@ -38,7 +38,8 @@ def _make_profile_image_name(username):
Returns the user-specific part of the image filename, based on a hash of
Returns the user-specific part of the image filename, based on a hash of
the username.
the username.
"""
"""
return
hashlib
.
md5
(
settings
.
PROFILE_IMAGE_SECRET_KEY
+
username
)
.
hexdigest
()
hash_input
=
settings
.
PROFILE_IMAGE_SECRET_KEY
+
username
return
hashlib
.
md5
(
hash_input
.
encode
(
'utf-8'
))
.
hexdigest
()
def
_get_profile_image_filename
(
name
,
size
,
file_extension
=
PROFILE_IMAGE_FILE_EXTENSION
):
def
_get_profile_image_filename
(
name
,
size
,
file_extension
=
PROFILE_IMAGE_FILE_EXTENSION
):
...
...
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