Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
5ea77433
Commit
5ea77433
authored
5 years ago
by
Calen Pennington
Browse files
Options
Downloads
Patches
Plain Diff
Only extract published dates into edx-when
parent
fe22e770
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/course_date_signals/handlers.py
+7
-2
7 additions, 2 deletions
openedx/core/djangoapps/course_date_signals/handlers.py
with
7 additions
and
2 deletions
openedx/core/djangoapps/course_date_signals/handlers.py
+
7
−
2
View file @
5ea77433
...
...
@@ -6,6 +6,7 @@ import logging
from
django.dispatch
import
receiver
from
six
import
text_type
from
xblock.fields
import
Scope
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
SignalHandler
,
modulestore
from
.models
import
SelfPacedRelativeDatesConfig
from
.utils
import
get_expected_duration
...
...
@@ -63,7 +64,9 @@ def extract_dates_from_course(course):
items
.
extend
(
next_item
.
get_children
())
else
:
date_items
=
[]
items
=
modulestore
().
get_items
(
course
.
id
)
store
=
modulestore
()
with
store
.
branch_setting
(
ModuleStoreEnum
.
Branch
.
published_only
,
course
.
id
):
items
=
store
.
get_items
(
course
.
id
)
log
.
info
(
'
Extracting dates from %d items in %s
'
,
len
(
items
),
course
.
id
)
for
item
in
items
:
date_items
.
append
((
item
.
location
,
_field_values
(
FIELDS_TO_EXTRACT
,
item
)))
...
...
@@ -75,7 +78,9 @@ def extract_dates(sender, course_key, **kwargs): # pylint: disable=unused-argum
"""
Extract dates from blocks when publishing a course.
"""
course
=
modulestore
().
get_course
(
course_key
)
store
=
modulestore
()
with
store
.
branch_setting
(
ModuleStoreEnum
.
Branch
.
published_only
,
course_key
):
course
=
store
.
get_course
(
course_key
)
if
not
course
:
log
.
info
(
"
No course found for key %s to extract dates from
"
,
course_key
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment