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
c21b3c8f
Commit
c21b3c8f
authored
Jun 14, 2017
by
Nimisha Asthagiri
Committed by
GitHub
Jun 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15323 from edx/ret/exclude-non-english-courses
Planning Prompts experiment: exclude non-English courses
parents
1904a93a
d465d6f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
lms/djangoapps/courseware/views/views.py
+8
-7
No files found.
lms/djangoapps/courseware/views/views.py
View file @
c21b3c8f
...
@@ -525,7 +525,7 @@ class CourseTabView(EdxFragmentView):
...
@@ -525,7 +525,7 @@ class CourseTabView(EdxFragmentView):
# TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts
# TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts
def
_should_display_planning_prompt
(
request
,
course
_overview
):
def
_should_display_planning_prompt
(
request
,
course
):
"""
"""
A planning prompt is enabled in the experiment for all enrollments whose
A planning prompt is enabled in the experiment for all enrollments whose
content availability date is less than 14 days from today.
content availability date is less than 14 days from today.
...
@@ -533,12 +533,13 @@ def _should_display_planning_prompt(request, course_overview):
...
@@ -533,12 +533,13 @@ def _should_display_planning_prompt(request, course_overview):
The content availability date is defined as either the course start date
The content availability date is defined as either the course start date
or the enrollment date, whichever was most recent.
or the enrollment date, whichever was most recent.
"""
"""
enrollment
=
CourseEnrollment
.
get_enrollment
(
request
.
user
,
course_overview
.
id
)
is_course_in_english
=
not
course
.
language
or
course
.
language
.
lower
()
==
u'en'
if
enrollment
:
if
is_course_in_english
:
content_availability_date
=
max
(
course_overview
.
start
,
enrollment
.
created
)
enrollment
=
CourseEnrollment
.
get_enrollment
(
request
.
user
,
course
.
id
)
return
content_availability_date
>
(
datetime
.
now
(
utc
)
-
timedelta
(
days
=
14
))
if
enrollment
and
enrollment
.
is_active
:
else
:
content_availability_date
=
max
(
course
.
start
,
enrollment
.
created
)
return
False
return
content_availability_date
>
(
datetime
.
now
(
utc
)
-
timedelta
(
days
=
14
))
return
False
# ENDTODO
# ENDTODO
...
...
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