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
7c8a9022
Commit
7c8a9022
authored
Mar 01, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'is None' and 'is not None'
parent
97f1e042
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
16 additions
and
17 deletions
+16
-17
cms/djangoapps/contentstore/management/commands/prompt.py
+1
-1
common/djangoapps/student/views.py
+3
-3
common/lib/xmodule/xmodule/peer_grading_module.py
+1
-1
lms/djangoapps/course_wiki/views.py
+1
-1
lms/djangoapps/courseware/grades.py
+1
-1
lms/djangoapps/multicourse/multicourse_settings.py
+1
-1
lms/djangoapps/simplewiki/views.py
+2
-2
lms/lib/comment_client/models.py
+1
-1
lms/lib/symmath/formula.py
+2
-2
lms/templates/courseware/course_navigation.html
+1
-1
lms/templates/problem.html
+2
-3
No files found.
cms/djangoapps/contentstore/management/commands/prompt.py
View file @
7c8a9022
...
...
@@ -13,7 +13,7 @@ def query_yes_no(question, default="yes"):
"""
valid
=
{
"yes"
:
True
,
"y"
:
True
,
"ye"
:
True
,
"no"
:
False
,
"n"
:
False
}
if
default
==
None
:
if
default
is
None
:
prompt
=
" [y/n] "
elif
default
==
"yes"
:
prompt
=
" [Y/n] "
...
...
common/djangoapps/student/views.py
View file @
7c8a9022
...
...
@@ -115,7 +115,7 @@ def get_date_for_press(publish_date):
def
press
(
request
):
json_articles
=
cache
.
get
(
"student_press_json_articles"
)
if
json_articles
==
None
:
if
json_articles
is
None
:
if
hasattr
(
settings
,
'RSS_URL'
):
content
=
urllib
.
urlopen
(
settings
.
PRESS_URL
)
.
read
()
json_articles
=
json
.
loads
(
content
)
...
...
@@ -301,7 +301,7 @@ def change_enrollment(request):
action
=
request
.
POST
.
get
(
"enrollment_action"
,
""
)
course_id
=
request
.
POST
.
get
(
"course_id"
,
None
)
if
course_id
==
None
:
if
course_id
is
None
:
return
HttpResponse
(
json
.
dumps
({
'success'
:
False
,
'error'
:
'There was an error receiving the course id.'
}))
...
...
@@ -1203,7 +1203,7 @@ def _get_news(top=None):
"Return the n top news items on settings.RSS_URL"
feed_data
=
cache
.
get
(
"students_index_rss_feed_data"
)
if
feed_data
==
None
:
if
feed_data
is
None
:
if
hasattr
(
settings
,
'RSS_URL'
):
feed_data
=
urllib
.
urlopen
(
settings
.
RSS_URL
)
.
read
()
else
:
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
7c8a9022
...
...
@@ -524,7 +524,7 @@ class PeerGradingModule(XModule):
'''
Show individual problem interface
'''
if
get
==
None
or
get
.
get
(
'location'
)
==
None
:
if
get
is
None
or
get
.
get
(
'location'
)
is
None
:
if
not
self
.
use_for_single_location
:
#This is an error case, because it must be set to use a single location to be called without get parameters
#This is a dev_facing_error
...
...
lms/djangoapps/course_wiki/views.py
View file @
7c8a9022
...
...
@@ -49,7 +49,7 @@ def course_wiki_redirect(request, course_id):
if
not
course_slug
:
log
.
exception
(
"This course is improperly configured. The slug cannot be empty."
)
valid_slug
=
False
if
re
.
match
(
'^[-
\
w
\
.]+$'
,
course_slug
)
==
None
:
if
re
.
match
(
'^[-
\
w
\
.]+$'
,
course_slug
)
is
None
:
log
.
exception
(
"This course is improperly configured. The slug can only contain letters, numbers, periods or hyphens."
)
valid_slug
=
False
...
...
lms/djangoapps/courseware/grades.py
View file @
7c8a9022
...
...
@@ -140,7 +140,7 @@ def grade(student, request, course, student_module_cache=None, keep_raw_scores=F
grading_context
=
course
.
grading_context
raw_scores
=
[]
if
student_module_cache
==
None
:
if
student_module_cache
is
None
:
student_module_cache
=
StudentModuleCache
(
course
.
id
,
student
,
grading_context
[
'all_descriptors'
])
totaled_scores
=
{}
...
...
lms/djangoapps/multicourse/multicourse_settings.py
View file @
7c8a9022
...
...
@@ -68,7 +68,7 @@ def get_course_settings(coursename):
def
is_valid_course
(
coursename
):
return
get_course_settings
(
coursename
)
!=
None
return
get_course_settings
(
coursename
)
is
not
None
def
get_course_property
(
coursename
,
property
):
...
...
lms/djangoapps/simplewiki/views.py
View file @
7c8a9022
...
...
@@ -236,7 +236,7 @@ def history(request, article_path, page=1, course_id=None):
page_size
=
10
if
page
==
None
:
if
page
is
None
:
page
=
1
try
:
p
=
int
(
page
)
...
...
@@ -310,7 +310,7 @@ def revision_feed(request, page=1, namespace=None, course_id=None):
page_size
=
10
if
page
==
None
:
if
page
is
None
:
page
=
1
try
:
p
=
int
(
page
)
...
...
lms/lib/comment_client/models.py
View file @
7c8a9022
...
...
@@ -23,7 +23,7 @@ class Model(object):
try
:
return
self
.
attributes
[
name
]
except
KeyError
:
if
self
.
retrieved
or
self
.
id
==
None
:
if
self
.
retrieved
or
self
.
id
is
None
:
raise
AttributeError
(
"Field {0} does not exist"
.
format
(
name
))
self
.
retrieve
()
return
self
.
__getattr__
(
name
)
...
...
lms/lib/symmath/formula.py
View file @
7c8a9022
...
...
@@ -70,7 +70,7 @@ StrPrinter._print_hat = _print_hat
def
to_latex
(
x
):
if
x
==
None
:
return
''
if
x
is
None
:
return
''
# LatexPrinter._print_dot = _print_dot
xs
=
latex
(
x
)
xs
=
xs
.
replace
(
r'\XI'
,
'XI'
)
# workaround for strange greek
...
...
@@ -278,7 +278,7 @@ class formula(object):
if
self
.
the_sympy
:
return
self
.
the_sympy
if
xml
==
None
:
# root
if
xml
is
None
:
# root
if
not
self
.
is_mathml
():
return
my_sympify
(
self
.
expr
)
if
self
.
is_presentation_mathml
():
...
...
lms/templates/courseware/course_navigation.html
View file @
7c8a9022
...
...
@@ -2,7 +2,7 @@
<
%
page
args=
"active_page=None"
/>
<
%
if
active_page
=
=
None
and
active_page_context
is
not
UNDEFINED:
if
active_page
is
None
and
active_page_context
is
not
UNDEFINED:
#
If
active_page
is
not
passed
in
as
an
argument
,
it
may
be
in
the
context
as
active_page_context
active_page =
active_page_context
...
...
lms/templates/problem.html
View file @
7c8a9022
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<h2
class=
"problem-header"
>
${ problem['name'] }
% if problem['weight'] != 1 and problem['weight']
!=
None:
% if problem['weight'] != 1 and problem['weight']
is not
None:
: ${ problem['weight'] } points
% endif
</h2>
...
...
@@ -30,4 +30,4 @@
</section>
% endif
</section>
</section>
\ No newline at end of file
</section>
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