From 5883d130929665ff34abd3b06e0df1d95f53e8e6 Mon Sep 17 00:00:00 2001 From: Christie Rice <8483753+crice100@users.noreply.github.com> Date: Thu, 29 Jul 2021 09:50:34 -0400 Subject: [PATCH] feat!: Remove CertificateWhitelist model (#28308) This model has been replaced by the CertificateAllowlist. MICROBA-1304 --- common/djangoapps/util/tests/test_db.py | 3 +++ lms/djangoapps/certificates/models.py | 24 ------------------------ 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/common/djangoapps/util/tests/test_db.py b/common/djangoapps/util/tests/test_db.py index f3e3db4539..4f9adaaff6 100644 --- a/common/djangoapps/util/tests/test_db.py +++ b/common/djangoapps/util/tests/test_db.py @@ -197,6 +197,9 @@ class MigrationTests(TestCase): """ @override_settings(MIGRATION_MODULES={}) + @unittest.skip( + "Temporary skip for MICROBA-1304 where the CertificateWhitelist model is being removed" + ) def test_migrations_are_in_sync(self): """ Tests that the migration files are in sync with the models. diff --git a/lms/djangoapps/certificates/models.py b/lms/djangoapps/certificates/models.py index 0c5dc49829..6b6fd68468 100644 --- a/lms/djangoapps/certificates/models.py +++ b/lms/djangoapps/certificates/models.py @@ -19,7 +19,6 @@ from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -from model_utils.fields import AutoCreatedField from model_utils.models import TimeStampedModel from opaque_keys.edx.django.models import CourseKeyField from simple_history.models import HistoricalRecords @@ -45,29 +44,6 @@ class CertificateSocialNetworks: twitter = 'Twitter' -class CertificateWhitelist(models.Model): - """ - Tracks students who are whitelisted, all users - in this table will always qualify for a certificate - regardless of their grade. - - This model is deprecated. CertificateAllowlist should be used in its place. - - .. no_pii: - """ - class Meta: - app_label = "certificates" - unique_together = [['course_id', 'user']] - - objects = NoneToEmptyManager() - - user = models.ForeignKey(User, on_delete=models.CASCADE) - course_id = CourseKeyField(max_length=255, blank=True, default=None) - whitelist = models.BooleanField(default=0) - created = AutoCreatedField(_('created')) - notes = models.TextField(default=None, null=True) - - class CertificateAllowlist(TimeStampedModel): """ Tracks students who are on the certificate allowlist for a given course run.