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
caeac692
Commit
caeac692
authored
Nov 01, 2016
by
Eric Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fast-fail grades tasks if feature flag disabled
parent
333c6866
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
lms/djangoapps/grades/tasks.py
+3
-0
lms/djangoapps/grades/tests/test_tasks.py
+1
-1
No files found.
lms/djangoapps/grades/tasks.py
View file @
caeac692
...
@@ -13,6 +13,7 @@ from opaque_keys.edx.locator import CourseLocator
...
@@ -13,6 +13,7 @@ from opaque_keys.edx.locator import CourseLocator
from
openedx.core.djangoapps.content.block_structure.api
import
get_course_in_cache
from
openedx.core.djangoapps.content.block_structure.api
import
get_course_in_cache
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
.config.models
import
PersistentGradesEnabledFlag
from
.new.course_grade
import
CourseGradeFactory
from
.new.course_grade
import
CourseGradeFactory
from
.new.subsection_grade
import
SubsectionGradeFactory
from
.new.subsection_grade
import
SubsectionGradeFactory
from
.signals.signals
import
SUBSECTION_SCORE_CHANGED
from
.signals.signals
import
SUBSECTION_SCORE_CHANGED
...
@@ -76,6 +77,8 @@ def recalculate_course_grade(user_id, course_id):
...
@@ -76,6 +77,8 @@ def recalculate_course_grade(user_id, course_id):
- user_id: serialized id of applicable User object
- user_id: serialized id of applicable User object
- course_id: Unicode string representing the course
- course_id: Unicode string representing the course
"""
"""
if
not
PersistentGradesEnabledFlag
.
feature_enabled
(
course_id
):
return
student
=
User
.
objects
.
get
(
id
=
user_id
)
student
=
User
.
objects
.
get
(
id
=
user_id
)
course_key
=
CourseLocator
.
from_string
(
course_id
)
course_key
=
CourseLocator
.
from_string
(
course_id
)
course
=
modulestore
()
.
get_course
(
course_key
,
depth
=
0
)
course
=
modulestore
()
.
get_course
(
course_key
,
depth
=
0
)
...
...
lms/djangoapps/grades/tests/test_tasks.py
View file @
caeac692
...
@@ -179,7 +179,7 @@ class RecalculateSubsectionGradeTest(ModuleStoreTestCase):
...
@@ -179,7 +179,7 @@ class RecalculateSubsectionGradeTest(ModuleStoreTestCase):
self
.
set_up_course
(
enable_subsection_grades
=
False
)
self
.
set_up_course
(
enable_subsection_grades
=
False
)
self
.
assertFalse
(
PersistentGradesEnabledFlag
.
feature_enabled
(
self
.
course
.
id
))
self
.
assertFalse
(
PersistentGradesEnabledFlag
.
feature_enabled
(
self
.
course
.
id
))
additional_queries
=
1
if
default_store
==
ModuleStoreEnum
.
Type
.
mongo
else
0
additional_queries
=
1
if
default_store
==
ModuleStoreEnum
.
Type
.
mongo
else
0
with
check_mongo_calls
(
2
)
and
self
.
assertNumQueries
(
16
+
additional_queries
):
with
check_mongo_calls
(
2
)
and
self
.
assertNumQueries
(
5
):
recalculate_subsection_grade
.
apply
(
args
=
tuple
(
self
.
score_changed_kwargs
.
values
()))
recalculate_subsection_grade
.
apply
(
args
=
tuple
(
self
.
score_changed_kwargs
.
values
()))
@skip
(
"Pending completion of TNL-5089"
)
@skip
(
"Pending completion of TNL-5089"
)
...
...
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