Files
edx-platform/openedx/core/djangoapps/schedules/models.py
Tyler Hallada 1bcd3a45ca Refactor upgrade_reminder to use async celery task
Finish test_base.py tests

Address some PR comments

Some test_send_recurring_nudge fixes

Fix test_schedule_bin

Fix test_site_config

Fix test_multiple_enrollments

Tests pass now!

Use consistent naming: upgrade_reminder
2017-10-06 13:34:23 -04:00

40 lines
1.3 KiB
Python

from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.models import TimeStampedModel
from django.contrib.sites.models import Site
from config_models.models import ConfigurationModel
class Schedule(TimeStampedModel):
enrollment = models.OneToOneField('student.CourseEnrollment', null=False)
active = models.BooleanField(
default=True,
help_text=_('Indicates if this schedule is actively used')
)
start = models.DateTimeField(
db_index=True,
help_text=_('Date this schedule went into effect')
)
upgrade_deadline = models.DateTimeField(
blank=True,
db_index=True,
null=True,
help_text=_('Deadline by which the learner must upgrade to a verified seat')
)
class Meta(object):
verbose_name = _('Schedule')
verbose_name_plural = _('Schedules')
class ScheduleConfig(ConfigurationModel):
KEY_FIELDS = ('site',)
site = models.ForeignKey(Site)
create_schedules = models.BooleanField(default=False)
enqueue_recurring_nudge = models.BooleanField(default=False)
deliver_recurring_nudge = models.BooleanField(default=False)
enqueue_upgrade_reminder = models.BooleanField(default=False)
deliver_upgrade_reminder = models.BooleanField(default=False)