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
OpenEdx
edx-platform
Commits
fcf6f58a
Unverified
Commit
fcf6f58a
authored
Oct 31, 2017
by
Jesse Zoldak
Committed by
GitHub
Oct 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Import Cleanup and Adding Logging message"
parent
15ced133
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
lms/djangoapps/courseware/views/views.py
+3
-10
No files found.
lms/djangoapps/courseware/views/views.py
View file @
fcf6f58a
...
@@ -5,11 +5,12 @@ import json
...
@@ -5,11 +5,12 @@ import json
import
logging
import
logging
import
urllib
import
urllib
from
collections
import
OrderedDict
,
namedtuple
from
collections
import
OrderedDict
,
namedtuple
from
datetime
import
datetime
from
datetime
import
datetime
,
timedelta
import
analytics
import
analytics
import
shoppingcart
import
shoppingcart
import
survey.views
import
survey.views
import
waffle
from
certificates
import
api
as
certs_api
from
certificates
import
api
as
certs_api
from
certificates.models
import
CertificateStatuses
from
certificates.models
import
CertificateStatuses
from
commerce.utils
import
EcommerceService
from
commerce.utils
import
EcommerceService
...
@@ -68,6 +69,7 @@ from markupsafe import escape
...
@@ -68,6 +69,7 @@ from markupsafe import escape
from
opaque_keys
import
InvalidKeyError
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
,
UsageKey
from
opaque_keys.edx.keys
import
CourseKey
,
UsageKey
from
openedx.core.djangoapps.catalog.utils
import
get_programs
,
get_programs_with_type
from
openedx.core.djangoapps.catalog.utils
import
get_programs
,
get_programs_with_type
from
openedx.core.djangoapps.certificates
import
api
as
auto_certs_api
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.djangoapps.credit.api
import
(
from
openedx.core.djangoapps.credit.api
import
(
get_credit_requirement_status
,
get_credit_requirement_status
,
...
@@ -1341,19 +1343,10 @@ def generate_user_cert(request, course_id):
...
@@ -1341,19 +1343,10 @@ def generate_user_cert(request, course_id):
return
HttpResponseBadRequest
(
_
(
"Course is not valid"
))
return
HttpResponseBadRequest
(
_
(
"Course is not valid"
))
if
not
is_course_passed
(
student
,
course
):
if
not
is_course_passed
(
student
,
course
):
log
.
info
(
u"User
%
s has not passed the course:
%
s"
,
student
.
username
,
course_id
)
return
HttpResponseBadRequest
(
_
(
"Your certificate will be available when you pass the course."
))
return
HttpResponseBadRequest
(
_
(
"Your certificate will be available when you pass the course."
))
certificate_status
=
certs_api
.
certificate_downloadable_status
(
student
,
course
.
id
)
certificate_status
=
certs_api
.
certificate_downloadable_status
(
student
,
course
.
id
)
log
.
info
(
u"User
%
s has requested for certificate in
%
s, current status: is_downloadable:
%
s, is_generating:
%
s"
,
student
.
username
,
course_id
,
certificate_status
[
"is_downloadable"
],
certificate_status
[
"is_generating"
],
)
if
certificate_status
[
"is_downloadable"
]:
if
certificate_status
[
"is_downloadable"
]:
return
HttpResponseBadRequest
(
_
(
"Certificate has already been created."
))
return
HttpResponseBadRequest
(
_
(
"Certificate has already been created."
))
elif
certificate_status
[
"is_generating"
]:
elif
certificate_status
[
"is_generating"
]:
...
...
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