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
d465d6f7
Commit
d465d6f7
authored
Jun 14, 2017
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Planning Prompts experiment: exclude non-English courses
parent
09e22f37
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 @
d465d6f7
...
...
@@ -525,7 +525,7 @@ class CourseTabView(EdxFragmentView):
# 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
content availability date is less than 14 days from today.
...
...
@@ -533,12 +533,13 @@ def _should_display_planning_prompt(request, course_overview):
The content availability date is defined as either the course start date
or the enrollment date, whichever was most recent.
"""
enrollment
=
CourseEnrollment
.
get_enrollment
(
request
.
user
,
course_overview
.
id
)
if
enrollment
:
content_availability_date
=
max
(
course_overview
.
start
,
enrollment
.
created
)
return
content_availability_date
>
(
datetime
.
now
(
utc
)
-
timedelta
(
days
=
14
))
else
:
return
False
is_course_in_english
=
not
course
.
language
or
course
.
language
.
lower
()
==
u'en'
if
is_course_in_english
:
enrollment
=
CourseEnrollment
.
get_enrollment
(
request
.
user
,
course
.
id
)
if
enrollment
and
enrollment
.
is_active
:
content_availability_date
=
max
(
course
.
start
,
enrollment
.
created
)
return
content_availability_date
>
(
datetime
.
now
(
utc
)
-
timedelta
(
days
=
14
))
return
False
# 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