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
ce19c769
Commit
ce19c769
authored
Apr 02, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of library versions in the library tools.
parent
51905f0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
common/lib/xmodule/xmodule/library_tools.py
+3
-6
No files found.
common/lib/xmodule/xmodule/library_tools.py
View file @
ce19c769
...
...
@@ -16,7 +16,7 @@ class LibraryToolsService(object):
def
__init__
(
self
,
modulestore
):
self
.
store
=
modulestore
def
_get_library
(
self
,
library_key
,
version
=
None
):
def
_get_library
(
self
,
library_key
):
"""
Given a library key like "library-v1:ProblemX+PR0B", return the
'library' XBlock with meta-information about the library.
...
...
@@ -28,9 +28,6 @@ class LibraryToolsService(object):
if
not
isinstance
(
library_key
,
LibraryLocator
):
library_key
=
LibraryLocator
.
from_string
(
library_key
)
if
version
:
library_key
.
for_version
(
version
)
try
:
return
self
.
store
.
get_library
(
library_key
,
remove_version
=
False
,
remove_branch
=
False
)
except
ItemNotFoundError
:
...
...
@@ -126,8 +123,8 @@ class LibraryToolsService(object):
return
source_blocks
=
[]
library_key
=
dest_block
.
source_library_key
library
=
self
.
_get_library
(
library_key
,
version
=
version
)
library_key
=
dest_block
.
source_library_key
.
for_version
(
version
)
library
=
self
.
_get_library
(
library_key
)
if
library
is
None
:
raise
ValueError
(
"Requested library not found."
)
if
user_perms
and
not
user_perms
.
can_read
(
library_key
):
...
...
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