From 5d3ff1482a2ffb2c9de8f2eb12a50ba99de7541c Mon Sep 17 00:00:00 2001 From: Marcos Date: Wed, 4 Sep 2024 12:50:56 -0300 Subject: [PATCH] fix: Added catch to not found exception --- edx_name_affirmation/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/edx_name_affirmation/models.py b/edx_name_affirmation/models.py index f0e0728..9a4c3a0 100644 --- a/edx_name_affirmation/models.py +++ b/edx_name_affirmation/models.py @@ -57,12 +57,12 @@ def verification_attempt_status(self): if not self.verification_attempt_id or not SoftwareSecurePhotoVerification: return None - # breakpoint() - - verification = SoftwareSecurePhotoVerification.objects.get(id=self.verification_attempt_id) - - return verification.status if verification else None + try: + verification = SoftwareSecurePhotoVerification.objects.get(id=self.verification_attempt_id) + return verification.status if verification else None + except SoftwareSecurePhotoVerification.DoesNotExist: + return None class VerifiedNameConfig(ConfigurationModel): """