-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API functions for the new generic VerificationAttempt model in the ve…
…rify_student app (#35338) * feat: add VerificationAttempt model to verify_student application This commits adds a VerificationAttempt model to store implementation and provider agnostic information about identity verification attempts in the platform. * feat: add api for VerificationAttempt model * fix: error handling for update - added tests accordingly - also took care of some nits * chore: lint * chore: lint for equals spaces * feat: using generic update function instead - can now update name, status, and exp. date on generic attempts - changed tests accordingly - a few nits * chore: fix docstring args * fix: corrected status validation - reverted to old status validation method - fixed tests accordingly * fix: datetime, status, and annotation fixes - expiration_datetime can be updated to None - VerificationAttemptStatus is now StrEnum - Added type annotations for api functions --------- Co-authored-by: michaelroytman <[email protected]>
- Loading branch information
1 parent
fbd7d4c
commit a3871cd
Showing
6 changed files
with
251 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ | |
|
||
class WindowExpiredException(Exception): | ||
pass | ||
|
||
|
||
class VerificationAttemptInvalidStatus(Exception): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
""" | ||
Status enums for verify_student. | ||
""" | ||
from enum import StrEnum, auto | ||
|
||
|
||
class VerificationAttemptStatus: | ||
class VerificationAttemptStatus(StrEnum): | ||
"""This class describes valid statuses for a verification attempt to be in.""" | ||
|
||
# This is the initial state of a verification attempt, before a learner has started IDV. | ||
created = "created" | ||
CREATED = auto() | ||
|
||
# A verification attempt is pending when it has been started but has not yet been completed. | ||
pending = "pending" | ||
PENDING = auto() | ||
|
||
# A verification attempt is approved when it has been approved by some mechanism (e.g. automatic review, manual | ||
# review, etc). | ||
approved = "approved" | ||
APPROVED = auto() | ||
|
||
# A verification attempt is denied when it has been denied by some mechanism (e.g. automatic review, manual review, | ||
# etc). | ||
denied = "denied" | ||
DENIED = auto() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters