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
2e0beac3
Commit
2e0beac3
authored
Mar 04, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update some strings to reflect the new behaviour
parent
93e5a56d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
common/lib/xmodule/xmodule/library_content_module.py
+2
-2
common/lib/xmodule/xmodule/library_tools.py
+6
-6
common/lib/xmodule/xmodule/tests/test_library_content.py
+3
-3
common/test/acceptance/tests/studio/test_studio_library_container.py
+1
-1
No files found.
common/lib/xmodule/xmodule/library_content_module.py
View file @
2e0beac3
...
...
@@ -407,8 +407,8 @@ class LibraryContentDescriptor(LibraryContentFields, MakoModuleDescriptor, XmlDe
StudioValidationMessage
.
WARNING
,
(
ngettext
(
u'The specified librar
ies are
configured to fetch {count} problem, '
,
u'The specified librar
ies are
configured to fetch {count} problems, '
,
u'The specified librar
y is
configured to fetch {count} problem, '
,
u'The specified librar
y is
configured to fetch {count} problems, '
,
self
.
max_count
)
+
ngettext
(
...
...
common/lib/xmodule/xmodule/library_tools.py
View file @
2e0beac3
...
...
@@ -104,15 +104,15 @@ class LibraryToolsService(object):
def
update_children
(
self
,
dest_block
,
user_id
,
user_perms
=
None
):
"""
This method is to be used when
any of the libraries
that a LibraryContentModule
references ha
ve
been updated. It will re-fetch all matching blocks from
This method is to be used when
the library
that a LibraryContentModule
references ha
s
been updated. It will re-fetch all matching blocks from
the libraries, and copy them as children of dest_block. The children
will be given new block_ids, but the definition ID used should be the
exact same definition ID used in the library.
This method will update dest_block's 'source_librar
ies' field to store
the version number of the libraries used, so we easily determine if
dest_block is up to date or not.
This method will update dest_block's 'source_librar
y_version' field to
store the version number of the libraries used, so we easily determine
if
dest_block is up to date or not.
"""
if
user_perms
and
not
user_perms
.
can_write
(
dest_block
.
location
.
course_key
):
raise
PermissionDenied
()
...
...
@@ -125,7 +125,7 @@ class LibraryToolsService(object):
library_key
=
dest_block
.
source_library_key
library
=
self
.
_get_library
(
library_key
)
if
library
is
None
:
raise
ValueError
(
"Requ
ir
ed library not found."
)
raise
ValueError
(
"Requ
est
ed library not found."
)
if
user_perms
and
not
user_perms
.
can_read
(
library_key
):
raise
PermissionDenied
()
filter_children
=
(
dest_block
.
capa_type
!=
ANY_CAPA_TYPE_VALUE
)
...
...
common/lib/xmodule/xmodule/tests/test_library_content.py
View file @
2e0beac3
...
...
@@ -126,14 +126,14 @@ class TestLibraryContentModule(LibraryContentTest):
Test that the validation method of LibraryContent blocks can validate
the source_library setting.
"""
# When source_librar
ies
is blank, the validation summary should say this block needs to be configured:
# When source_librar
y_id
is blank, the validation summary should say this block needs to be configured:
self
.
lc_block
.
source_library_id
=
""
result
=
self
.
lc_block
.
validate
()
self
.
assertFalse
(
result
)
# Validation fails due to at least one warning/message
self
.
assertTrue
(
result
.
summary
)
self
.
assertEqual
(
StudioValidationMessage
.
NOT_CONFIGURED
,
result
.
summary
.
type
)
# When source_librar
ies
references a non-existent library, we should get an error:
# When source_librar
y_id
references a non-existent library, we should get an error:
self
.
lc_block
.
source_library_id
=
"library-v1:BAD+WOLF"
result
=
self
.
lc_block
.
validate
()
self
.
assertFalse
(
result
)
# Validation fails due to at least one warning/message
...
...
@@ -141,7 +141,7 @@ class TestLibraryContentModule(LibraryContentTest):
self
.
assertEqual
(
StudioValidationMessage
.
ERROR
,
result
.
summary
.
type
)
self
.
assertIn
(
"invalid"
,
result
.
summary
.
text
)
# When source_librar
ies
is set but the block needs to be updated, the summary should say so:
# When source_librar
y_id
is set but the block needs to be updated, the summary should say so:
self
.
lc_block
.
source_library_id
=
unicode
(
self
.
library
.
location
.
library_key
)
result
=
self
.
lc_block
.
validate
()
self
.
assertFalse
(
result
)
# Validation fails due to at least one warning/message
...
...
common/test/acceptance/tests/studio/test_studio_library_container.py
View file @
2e0beac3
...
...
@@ -219,7 +219,7 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
And I set Problem Type selector so "Any"
Then I can see that "No matching content" warning is shown
"""
expected_tpl
=
"The specified librar
ies are
configured to fetch {count} problems, "
\
expected_tpl
=
"The specified librar
y is
configured to fetch {count} problems, "
\
"but there are only {actual} matching problems."
library_container
=
self
.
_get_library_xblock_wrapper
(
self
.
unit_page
.
xblocks
[
1
])
...
...
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