Adding migration to store purchased mode in PaidCourseRegistration

This commit is contained in:
Jason Bau
2013-08-20 14:49:26 -07:00
committed by Diana Huang
parent 65f2814d73
commit efbb439cb5
6 changed files with 129 additions and 14 deletions

View File

@@ -33,6 +33,7 @@ class CourseMode(models.Model):
currency = models.CharField(default="usd", max_length=8)
DEFAULT_MODE = Mode('honor', _('Honor Code Certificate'), 0, '', 'usd')
DEFAULT_MODE_SLUG = 'honor'
class Meta:
""" meta attributes of this model """

View File

@@ -827,9 +827,6 @@ class CourseEnrollment(models.Model):
@classmethod
def is_enrolled(cls, user, course_id):
"""
Remove the user from a given course. If the relevant `CourseEnrollment`
object doesn't exist, we log an error but don't throw an exception.
Returns True if the user is enrolled in the course (the entry must exist
and it must have `is_active=True`). Otherwise, returns False.