Пример #1
0
 def _admin_form(self, mode, upgrade_deadline=None):
     """Load the course mode admin form. """
     course_mode = CourseModeFactory.create(
         course_id=self.course.id,
         mode_slug=mode,
     )
     return CourseModeForm({
         "course_id": unicode(self.course.id),
         "mode_slug": mode,
         "mode_display_name": mode,
         "_expiration_datetime": upgrade_deadline,
         "currency": "usd",
         "min_price": 10,
     }, instance=course_mode)
Пример #2
0
    def _configure(self, mode, upgrade_deadline=None, verification_deadline=None):
        """Configure course modes and deadlines. """
        course_mode = CourseModeFactory.create(
            mode_slug=mode,
            mode_display_name=mode,
        )

        if upgrade_deadline is not None:
            course_mode.upgrade_deadline = upgrade_deadline
            course_mode.save()

        VerificationDeadline.set_deadline(self.course.id, verification_deadline)

        return CourseModeForm(instance=course_mode)