diff --git a/lms/djangoapps/verify_student/migrations/0017_remove_verificationattempt_created_and_more.py b/lms/djangoapps/verify_student/migrations/0016_remove_verificationattempt_created_and_more.py similarity index 84% rename from lms/djangoapps/verify_student/migrations/0017_remove_verificationattempt_created_and_more.py rename to lms/djangoapps/verify_student/migrations/0016_remove_verificationattempt_created_and_more.py index 38f89402ad83..4954c32e12f1 100644 --- a/lms/djangoapps/verify_student/migrations/0017_remove_verificationattempt_created_and_more.py +++ b/lms/djangoapps/verify_student/migrations/0016_remove_verificationattempt_created_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.15 on 2024-09-26 18:59 +# Generated by Django 4.2.15 on 2024-09-26 19:39 from django.db import migrations, models import django.utils.timezone @@ -9,7 +9,7 @@ class Migration(migrations.Migration): dependencies = [ - ('verify_student', '0016_verificationattempt_status_changed'), + ('verify_student', '0015_verificationattempt'), ] operations = [ @@ -32,6 +32,11 @@ class Migration(migrations.Migration): name='hide_status_from_user', field=models.BooleanField(default=False, null=True), ), + migrations.AddField( + model_name='verificationattempt', + name='status_changed', + field=model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', verbose_name='status changed'), + ), migrations.AlterField( model_name='verificationattempt', name='status', diff --git a/lms/djangoapps/verify_student/migrations/0016_verificationattempt_status_changed.py b/lms/djangoapps/verify_student/migrations/0016_verificationattempt_status_changed.py deleted file mode 100644 index d5aba6fd369d..000000000000 --- a/lms/djangoapps/verify_student/migrations/0016_verificationattempt_status_changed.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.2.15 on 2024-09-19 16:17 - -from django.db import migrations -import django.utils.timezone -import model_utils.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('verify_student', '0015_verificationattempt'), - ] - - operations = [ - migrations.AddField( - model_name='verificationattempt', - name='status_changed', - field=model_utils.fields.MonitorField(default=django.utils.timezone.now, monitor='status', verbose_name='status changed'), - ), - ] diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py index 32f02acd4af5..53e464ef9389 100644 --- a/lms/djangoapps/verify_student/models.py +++ b/lms/djangoapps/verify_student/models.py @@ -1251,11 +1251,6 @@ def should_display_status_to_user(self): """When called, returns true or false based on the type of VerificationAttempt""" return not self.hide_status_from_user - @property - def updated_at(self): - """Backwards compatibility with existing IDVerification models""" - return self.modified - @classmethod def retire_user(cls, user_id): """ diff --git a/lms/djangoapps/verify_student/services.py b/lms/djangoapps/verify_student/services.py index 1a2d145e892a..f0d8a8631482 100644 --- a/lms/djangoapps/verify_student/services.py +++ b/lms/djangoapps/verify_student/services.py @@ -76,7 +76,7 @@ def verifications_for_user(cls, user): Return a list of all verifications associated with the given user. """ verifications = [] - for verification in chain(VerificationAttempt.objects.filter(user=user).order_by('-created'), + for verification in chain(VerificationAttempt.objects.filter(user=user).order_by('-created_at'), SoftwareSecurePhotoVerification.objects.filter(user=user).order_by('-created_at'), SSOVerification.objects.filter(user=user).order_by('-created_at'), ManualVerification.objects.filter(user=user).order_by('-created_at')): @@ -97,7 +97,7 @@ def get_verified_user_ids(cls, users): VerificationAttempt.objects.filter(**{ 'user__in': users, 'status': 'approved', - 'created__gt': now() - timedelta(days=settings.VERIFY_STUDENT["DAYS_GOOD_FOR"]) + 'created_at__gt': now() - timedelta(days=settings.VERIFY_STUDENT["DAYS_GOOD_FOR"]) }).values_list('user_id', flat=True), SoftwareSecurePhotoVerification.objects.filter(**filter_kwargs).values_list('user_id', flat=True), SSOVerification.objects.filter(**filter_kwargs).values_list('user_id', flat=True),