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
04614078
Commit
04614078
authored
Jan 15, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proposed changes to fix asset caching bug.
parent
e884f17d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
cms/djangoapps/contentstore/views.py
+2
-1
common/lib/xmodule/xmodule/contentstore/content.py
+4
-2
No files found.
cms/djangoapps/contentstore/views.py
View file @
04614078
...
...
@@ -753,7 +753,8 @@ def upload_asset(request, org, course, coursename):
# nomenclature since we're using a FileSystem paradigm here. We're just imposing
# the Location string formatting expectations to keep things a bit more consistent
filename
=
request
.
FILES
[
'file'
]
.
name
# unicode needed for cache equivalency
filename
=
unicode
(
request
.
FILES
[
'file'
]
.
name
)
mime_type
=
request
.
FILES
[
'file'
]
.
content_type
filedata
=
request
.
FILES
[
'file'
]
.
read
()
...
...
common/lib/xmodule/xmodule/contentstore/content.py
View file @
04614078
...
...
@@ -29,12 +29,14 @@ class StaticContent(object):
@staticmethod
def
generate_thumbnail_name
(
original_name
):
return
(
'{0}'
+
XASSET_THUMBNAIL_TAIL_NAME
)
.
format
(
os
.
path
.
splitext
(
original_name
)[
0
])
# unicode needed for cache equivalency
return
unicode
((
'{0}'
+
XASSET_THUMBNAIL_TAIL_NAME
)
.
format
(
os
.
path
.
splitext
(
original_name
)[
0
]))
@staticmethod
def
compute_location
(
org
,
course
,
name
,
revision
=
None
,
is_thumbnail
=
False
):
name
=
name
.
replace
(
'/'
,
'_'
)
return
Location
([
XASSET_LOCATION_TAG
,
org
,
course
,
'asset'
if
not
is_thumbnail
else
'thumbnail'
,
Location
.
clean
(
name
),
revision
])
# unicode needed for cache equivalency
return
Location
([
unicode
(
XASSET_LOCATION_TAG
),
org
,
course
,
u'asset'
if
not
is_thumbnail
else
u'thumbnail'
,
Location
.
clean
(
name
),
revision
])
def
get_id
(
self
):
return
StaticContent
.
get_id_from_location
(
self
.
location
)
...
...
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