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
dba66c2a
Commit
dba66c2a
authored
May 21, 2014
by
Yihua LOU
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5 from edx/ned/tweak-pr-3730
Slight tweak to get_text
parents
f3371643
2c4fcb0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
common/lib/xmodule/xmodule/x_module.py
+7
-3
No files found.
common/lib/xmodule/xmodule/x_module.py
View file @
dba66c2a
...
...
@@ -778,6 +778,13 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
json_choice
=
field
.
to_json
(
json_choice
)
return
json_choice
def
get_text
(
value
):
"""Localize a text value that might be None."""
if
value
is
None
:
return
None
else
:
return
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
(
value
)
metadata_fields
=
{}
# Only use the fields from this class, not mixins
...
...
@@ -788,9 +795,6 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
if
field
.
scope
!=
Scope
.
settings
or
field
in
self
.
non_editable_metadata_fields
:
continue
def
get_text
(
value
):
return
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
(
value
)
if
value
is
not
None
else
None
# gets the 'default_value' and 'explicitly_set' attrs
metadata_fields
[
field
.
name
]
=
self
.
runtime
.
get_field_provenance
(
self
,
field
)
metadata_fields
[
field
.
name
][
'field_name'
]
=
field
.
name
...
...
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