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
4d157db6
Commit
4d157db6
authored
Jul 11, 2017
by
Nimisha Asthagiri
Committed by
GitHub
Jul 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15521 from edx/ret/cleanup-planning-prompts
RET: Cleanup Planning Prompts experimental code
parents
81c70be8
66bbe902
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
30 deletions
+2
-30
lms/djangoapps/courseware/views/views.py
+0
-22
lms/templates/courseware/experiments.html
+0
-6
openedx/features/course_experience/tests/views/test_course_home.py
+1
-1
openedx/features/course_experience/tests/views/test_course_updates.py
+1
-1
No files found.
lms/djangoapps/courseware/views/views.py
View file @
4d157db6
...
...
@@ -511,9 +511,6 @@ class CourseTabView(EdxFragmentView):
'upgrade_link'
:
check_and_get_upgrade_link
(
request
,
request
.
user
,
course
.
id
),
'upgrade_price'
:
get_cosmetic_verified_display_price
(
course
),
# ENDTODO
# TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts
'display_planning_prompt'
:
_should_display_planning_prompt
(
request
,
course
),
# ENDTODO
}
def
render_to_fragment
(
self
,
request
,
course
=
None
,
page_context
=
None
,
**
kwargs
):
...
...
@@ -533,25 +530,6 @@ class CourseTabView(EdxFragmentView):
return
render_to_response
(
'courseware/tab-view.html'
,
page_context
)
# TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts
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.
The content availability date is defined as either the course start date
or the enrollment date, whichever was most recent.
"""
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
@ensure_csrf_cookie
@ensure_valid_course_key
def
syllabus
(
request
,
course_id
):
...
...
lms/templates/courseware/experiments.html
View file @
4d157db6
...
...
@@ -9,9 +9,3 @@
</script>
% endif
## ENDTODO
## TODO: (Experimental Code). See https://openedx.atlassian.net/wiki/display/RET/3.+Planning+Prompts
% if display_planning_prompt:
<script
type=
"text/plain"
id=
"display_planning_prompt"
></script>
% endif
## ENDTODO
openedx/features/course_experience/tests/views/test_course_home.py
View file @
4d157db6
...
...
@@ -120,7 +120,7 @@ class TestCourseHomePage(CourseHomePageTestCase):
course_home_url
(
self
.
course
)
# Fetch the view and verify the query counts
with
self
.
assertNumQueries
(
3
9
,
table_blacklist
=
QUERY_COUNT_TABLE_BLACKLIST
):
with
self
.
assertNumQueries
(
3
8
,
table_blacklist
=
QUERY_COUNT_TABLE_BLACKLIST
):
with
check_mongo_calls
(
4
):
url
=
course_home_url
(
self
.
course
)
self
.
client
.
get
(
url
)
...
...
openedx/features/course_experience/tests/views/test_course_updates.py
View file @
4d157db6
...
...
@@ -127,7 +127,7 @@ class TestCourseUpdatesPage(SharedModuleStoreTestCase):
course_updates_url
(
self
.
course
)
# Fetch the view and verify that the query counts haven't changed
with
self
.
assertNumQueries
(
3
2
,
table_blacklist
=
QUERY_COUNT_TABLE_BLACKLIST
):
with
self
.
assertNumQueries
(
3
1
,
table_blacklist
=
QUERY_COUNT_TABLE_BLACKLIST
):
with
check_mongo_calls
(
4
):
url
=
course_updates_url
(
self
.
course
)
self
.
client
.
get
(
url
)
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