'add dummy registration code into models'

def add_reg_code(self, course_key, mode_slug=None, is_valid=True):

    if (mode_slug is None):
        mode_slug = self.course_mode.mode_slug
    course_reg_code = CourseRegistrationCode(code=self.reg_code, course_id=course_key, created_by=self.user, mode_slug=mode_slug, is_valid=is_valid)
    course_reg_code.save()
