Skip to content

Commit

Permalink
temp: idea to add should_display_status_to_user
Browse files Browse the repository at this point in the history
  • Loading branch information
ilee2u committed Sep 24, 2024
1 parent e048380 commit 3375f3e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion common/djangoapps/student/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def check_verify_status_by_course(user, course_enrollments):

# Check whether the user was approved or is awaiting approval
if relevant_verification is not None:
should_display = relevant_verification.should_display_status_to_user()
idv_type = relevant_verification.__name__
should_display = relevant_verification.should_display_status_to_user(idv_type=idv_type)

if relevant_verification.status == "approved":
if verification_expiring_soon:
Expand Down
12 changes: 10 additions & 2 deletions lms/djangoapps/verify_student/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,14 @@ def retire_user(cls, user_id):
verification_attempts.delete()

@classmethod
def should_display_status_to_user(cls):
def should_display_status_to_user(cls, idv_type):
"""When called, returns true or false based on the type of VerificationAttempt"""
return False
# NOTE: Do we also need another one here for persona
if idv_type == 'VerificationAttempt':
return False # Not sure what to return for this one.
elif idv_type == 'SoftwareSecurePhotoVerification':
return True
elif idv_type == 'SSOVerification':
return False
elif idv_type == 'ManualVerification':
return False
3 changes: 2 additions & 1 deletion lms/djangoapps/verify_student/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ def user_status(cls, user):
if not attempt:
return user_status

user_status['should_display'] = attempt.should_display_status_to_user()
idv_type = attempt.__name__
user_status['should_display'] = attempt.should_display_status_to_user(idv_type=idv_type)

if attempt.expiration_datetime < now() and attempt.status == 'approved':
if user_status['should_display']:
Expand Down

0 comments on commit 3375f3e

Please sign in to comment.