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
729127c3
Commit
729127c3
authored
Aug 30, 2017
by
Gregory Martin
Committed by
GitHub
Aug 30, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15920 from edx/yro/disable_nocertificate_date
Deactivate date display if no cert active
parents
e56966c1
43e14b91
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
lms/djangoapps/certificates/tests/test_webview_views.py
+1
-1
lms/djangoapps/courseware/date_summary.py
+13
-3
lms/djangoapps/courseware/tests/test_date_summary.py
+7
-0
No files found.
lms/djangoapps/certificates/tests/test_webview_views.py
View file @
729127c3
...
...
@@ -803,7 +803,7 @@ class CertificatesViewsTests(CommonCertificatesTestCase):
"""
self
.
course
.
self_paced
=
is_self_paced
self
.
course
.
save
()
self
.
_add_course_certificates
(
count
=
1
,
signatory_count
=
1
)
self
.
_add_course_certificates
(
count
=
1
,
signatory_count
=
1
,
is_active
=
True
)
test_url
=
get_certificate_url
(
user_id
=
self
.
user
.
id
,
course_id
=
unicode
(
self
.
course
.
id
)
...
...
lms/djangoapps/courseware/date_summary.py
View file @
729127c3
...
...
@@ -204,15 +204,25 @@ class CertificateAvailableDate(DateSummary):
title
=
ugettext_lazy
(
'Certificate Available'
)
@property
def
active_certificates
(
self
):
return
[
certificate
for
certificate
in
self
.
course
.
certificates
.
get
(
'certificates'
,
[])
if
certificate
.
get
(
'is_active'
,
False
)
]
@property
def
is_enabled
(
self
):
return
(
self
.
date
is
not
None
and
datetime
.
datetime
.
now
(
utc
)
<=
self
.
date
and
not
self
.
course
.
self_paced
and
waffle
.
waffle
()
.
is_enabled
(
waffle
.
INSTRUCTOR_PACED_ONLY
)
self
.
date
is
not
None
and
datetime
.
datetime
.
now
(
utc
)
<=
self
.
date
and
not
self
.
course
.
self_paced
and
waffle
.
waffle
()
.
is_enabled
(
waffle
.
INSTRUCTOR_PACED_ONLY
)
and
len
(
self
.
active_certificates
)
>
0
)
@property
def
description
(
self
):
return
_
(
'Day certificates will become available for passing verified learners.'
)
return
_
(
'Day certificates will become available for passing verified learners.'
+
str
(
self
.
active_certificates
)
)
@property
def
date
(
self
):
...
...
lms/djangoapps/courseware/tests/test_date_summary.py
View file @
729127c3
...
...
@@ -382,6 +382,13 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
verified_user
=
self
.
create_user
()
CourseEnrollmentFactory
(
course_id
=
course
.
id
,
user
=
verified_user
,
mode
=
CourseMode
.
VERIFIED
)
course
.
certificate_available_date
=
datetime
.
now
(
utc
)
+
timedelta
(
days
=
7
)
course
.
certificates
=
{
u'certificates'
:
[{
u'course_title'
:
u'Test'
,
u'name'
:
u''
,
u'is_active'
:
True
,
}]
}
course
.
save
()
CertificateAvailableDate
(
course
,
audit_user
)
for
block
in
(
CertificateAvailableDate
(
course
,
audit_user
),
CertificateAvailableDate
(
course
,
verified_user
)):
...
...
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