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
8042332c
Commit
8042332c
authored
Nov 08, 2013
by
Julia Hansbrough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
purchased_callback now uses the change_mode method
parent
94b8b0ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
5 deletions
+2
-5
common/djangoapps/student/models.py
+1
-3
lms/djangoapps/shoppingcart/models.py
+1
-2
No files found.
common/djangoapps/student/models.py
View file @
8042332c
...
...
@@ -875,9 +875,6 @@ class CourseEnrollment(models.Model):
cls
.
create_or_update_enrollment
(
user
,
course_id
,
record
.
mode
,
is_active
=
False
)
unenroll_done
.
send
(
sender
=
cls
,
course_enrollment
=
record
)
# TODO: Do we still need to emit this event since unenroll now calls create_or_update_enrollment?
#record.emit_event(EVENT_NAME_ENROLLMENT_DEACTIVATED)
except
cls
.
DoesNotExist
:
err_msg
=
u"Tried to unenroll student {} from {} but they were not enrolled"
log
.
error
(
err_msg
.
format
(
user
,
course_id
))
...
...
@@ -978,6 +975,7 @@ class CourseEnrollment(models.Model):
CourseEnrollment
.
create_or_update_enrollment
(
self
.
user
,
self
.
course_id
,
self
.
mode
,
False
)
def
change_mode
(
self
,
mode
):
"""Changes this `CourseEnrollment` record's mode to `mode`. Saves immediately."""
self
.
mode
=
mode
CourseEnrollment
.
create_or_update_enrollment
(
self
.
user
,
self
.
course_id
,
mode
,
self
.
is_active
)
...
...
lms/djangoapps/shoppingcart/models.py
View file @
8042332c
...
...
@@ -506,8 +506,7 @@ class CertificateItem(OrderItem):
"Could not submit verification attempt for enrollment {}"
.
format
(
self
.
course_enrollment
)
)
self
.
course_enrollment
.
mode
=
self
.
mode
self
.
course_enrollment
.
save
()
self
.
course_enrollment
.
change_mode
(
self
.
mode
)
self
.
course_enrollment
.
activate
()
@property
...
...
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