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
3ea28a93
Commit
3ea28a93
authored
Aug 26, 2016
by
Chris
Committed by
GitHub
Aug 26, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13326 from edx/release
Release with hotfixes 2016-08-23
parents
d440124c
15dab29b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
common/djangoapps/xmodule_django/models.py
+24
-1
lms/templates/ccx/coach_dashboard.html
+4
-4
requirements/edx/base.txt
+1
-1
No files found.
common/djangoapps/xmodule_django/models.py
View file @
3ea28a93
...
...
@@ -2,11 +2,14 @@
Useful django models for implementing XBlock infrastructure in django.
"""
import
warnings
import
logging
from
django.db
import
models
from
django.core.exceptions
import
ValidationError
from
opaque_keys.edx.keys
import
CourseKey
,
UsageKey
,
BlockTypeKey
log
=
logging
.
getLogger
(
__name__
)
class
NoneToEmptyManager
(
models
.
Manager
):
"""
...
...
@@ -104,6 +107,16 @@ class OpaqueKeyField(models.CharField):
return
None
if
isinstance
(
value
,
basestring
):
if
value
.
endswith
(
'
\n
'
):
# An opaque key with a trailing newline has leaked into the DB.
# Log and strip the value.
log
.
warning
(
u'{}:{}:{}:to_python: Invalid key: {}. Removing trailing newline.'
.
format
(
self
.
model
.
_meta
.
db_table
,
# pylint: disable=protected-access
self
.
name
,
self
.
KEY_CLASS
.
__name__
,
repr
(
value
)
))
value
=
value
.
rstrip
()
return
self
.
KEY_CLASS
.
from_string
(
value
)
else
:
return
value
...
...
@@ -123,7 +136,17 @@ class OpaqueKeyField(models.CharField):
return
''
# CharFields should use '' as their empty value, rather than None
assert
isinstance
(
value
,
self
.
KEY_CLASS
),
"
%
s is not an instance of
%
s"
%
(
value
,
self
.
KEY_CLASS
)
return
unicode
(
_strip_value
(
value
))
serialized_key
=
unicode
(
_strip_value
(
value
))
if
serialized_key
.
endswith
(
'
\n
'
):
# An opaque key object serialized to a string with a trailing newline.
# Log the value - but do not modify it.
log
.
warning
(
u'{}:{}:{}:get_prep_value: Invalid key: {}.'
.
format
(
self
.
model
.
_meta
.
db_table
,
# pylint: disable=protected-access
self
.
name
,
self
.
KEY_CLASS
.
__name__
,
repr
(
serialized_key
)
))
return
serialized_key
def
validate
(
self
,
value
,
model_instance
):
"""Validate Empty values, otherwise defer to the parent"""
...
...
lms/templates/ccx/coach_dashboard.html
View file @
3ea28a93
...
...
@@ -89,9 +89,9 @@ from openedx.core.djangolib.js_utils import (
<script>
function
setup_tabs
()
{
$
(
".instructor-nav
a
"
).
on
(
"click"
,
function
(
event
)
{
$
(
".instructor-nav
.btn-link
"
).
on
(
"click"
,
function
(
event
)
{
event
.
preventDefault
();
$
(
".instructor-nav
a
"
).
removeClass
(
"active-section"
);
$
(
".instructor-nav
.btn-link
"
).
removeClass
(
"active-section"
);
var
section_sel
=
"#"
+
$
(
this
).
attr
(
"data-section"
);
$
(
"section.idash-section"
).
hide
();
$
(
section_sel
).
show
();
...
...
@@ -101,12 +101,12 @@ from openedx.core.djangolib.js_utils import (
var
url
=
document
.
URL
,
hashbang
=
url
.
indexOf
(
'#!'
);
if
(
hashbang
!=
-
1
)
{
var
selector
=
'.instructor-nav
a
[data-section='
+
var
selector
=
'.instructor-nav [data-section='
+
url
.
substr
(
hashbang
+
2
)
+
']'
;
$
(
selector
).
click
();
}
else
{
$
(
".instructor-nav
a
"
).
first
().
click
();
$
(
".instructor-nav
.btn-link
"
).
first
().
click
();
}
}
...
...
requirements/edx/base.txt
View file @
3ea28a93
...
...
@@ -44,7 +44,7 @@ edx-lint==0.4.3
edx-django-oauth2-provider==1.1.1
edx-django-sites-extensions==2.0.1
edx-oauth2-provider==1.1.3
edx-opaque-keys==0.
2.1
edx-opaque-keys==0.
3.3
edx-organizations==0.4.1
edx-rest-api-client==1.2.1
edx-search==0.1.2
...
...
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