feat(verification): handle user verification not found scenario and mark user as verified
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 3m0s

This commit is contained in:
2025-07-24 23:35:24 +05:00
parent 446ca6653e
commit 087782e351
2 changed files with 34 additions and 0 deletions

View File

@@ -414,6 +414,16 @@ class UserVerifyAPIView(StaffEditorPermissionMixin, generics.UpdateAPIView):
serializer = self.get_serializer(user, data=request.data, partial=True)
serializer.is_valid(raise_exception=True)
result = check_person_api_verification(user_data=user, id_card=user.id_card)
# The verification system might not have the records of every user hence can be skipped if not found and verify directly.
if result.get("error") == "Not Found":
user.verified = True
user.save()
return Response(
{
"message": "User not found in the verification system. User marked as verified."
},
status=status.HTTP_404_NOT_FOUND,
)
if not result["ok"]:
return Response(
result,