Skip to content

Commit fa8df9d

Browse files
Unreorder existing attempt check
1 parent 0d19fc2 commit fa8df9d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

app/backend/src/couchers/jobs/handlers.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -953,12 +953,6 @@ def finalize_strong_verification(payload: jobs_pb2.FinalizeStrongVerificationPay
953953
nationality = json_data["nationality"]
954954
last_three_document_chars = json_data["document_number"][-3:]
955955

956-
verification_attempt.has_minimal_data = True
957-
verification_attempt.passport_expiry_date = expiry_date
958-
verification_attempt.passport_nationality = nationality
959-
verification_attempt.passport_last_three_document_chars = last_three_document_chars
960-
961-
# Check whether there was already an attempt with this passport.
962956
existing_attempt = session.execute(
963957
select(StrongVerificationAttempt)
964958
.where(StrongVerificationAttempt.passport_expiry_date == expiry_date)
@@ -968,6 +962,11 @@ def finalize_strong_verification(payload: jobs_pb2.FinalizeStrongVerificationPay
968962
.limit(1)
969963
).scalar_one_or_none()
970964

965+
verification_attempt.has_minimal_data = True
966+
verification_attempt.passport_expiry_date = expiry_date
967+
verification_attempt.passport_nationality = nationality
968+
verification_attempt.passport_last_three_document_chars = last_three_document_chars
969+
971970
if existing_attempt:
972971
verification_attempt.status = StrongVerificationAttemptStatus.duplicate
973972

0 commit comments

Comments
 (0)