Skip to content

Commit

Permalink
fix: squash commits
Browse files Browse the repository at this point in the history
- also remove extra updated_at property
  • Loading branch information
ilee2u committed Sep 26, 2024
1 parent 72f7e26 commit e5a2e83
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@
class Migration(migrations.Migration):

dependencies = [
('verify_student', '0016_verificationattempt_status_changed'),
('verify_student', '0015_verificationattempt'),
]

operations = [
Expand All @@ -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',
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions lms/djangoapps/verify_student/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/verify_student/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')):
Expand All @@ -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),
Expand Down

0 comments on commit e5a2e83

Please sign in to comment.