adds validation error for letter verification code [#395]
This commit is contained in:
@@ -22,6 +22,18 @@ class Verification::Letter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def verify?
|
def verify?
|
||||||
|
letter_sent?
|
||||||
|
correct_code?
|
||||||
|
errors.blank?
|
||||||
|
end
|
||||||
|
|
||||||
|
def letter_sent?
|
||||||
|
errors.add(:verification_code, I18n.t('verification.letter.errors.letter_not_sent')) unless
|
||||||
|
user.letter_sent_at.present?
|
||||||
|
end
|
||||||
|
|
||||||
|
def correct_code?
|
||||||
|
errors.add(:verification_code, I18n.t('verification.letter.errors.incorect_code')) unless
|
||||||
user.letter_verification_code == verification_code
|
user.letter_verification_code == verification_code
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -78,12 +78,15 @@ en:
|
|||||||
title: "Security code confirmation"
|
title: "Security code confirmation"
|
||||||
confirmation_code: "Enter the security code in your letter"
|
confirmation_code: "Enter the security code in your letter"
|
||||||
update:
|
update:
|
||||||
error: "Incorrect confirmation code"
|
|
||||||
flash:
|
flash:
|
||||||
success: "Correct code. Your account is verified"
|
success: "Correct code. Your account is verified"
|
||||||
alert:
|
alert:
|
||||||
unconfirmed_code: "You have not yet enter the confirmation code"
|
unconfirmed_code: "You have not yet enter the confirmation code"
|
||||||
verify_attemps_left: "You have reached the maximum number of letter verification tries"
|
verify_attemps_left: "You have reached the maximum number of letter verification tries"
|
||||||
|
errors:
|
||||||
|
letter_not_sent: "We have not sent you the letter with the code yet"
|
||||||
|
incorect_code: "Incorrect confirmation code"
|
||||||
|
address_not_found: "Address not found"
|
||||||
verified_user:
|
verified_user:
|
||||||
show:
|
show:
|
||||||
title: "Available information"
|
title: "Available information"
|
||||||
|
|||||||
@@ -78,12 +78,18 @@ es:
|
|||||||
title: "Confirmación de código de seguridad"
|
title: "Confirmación de código de seguridad"
|
||||||
confirmation_code: "Introduce el código que has recibido en tu carta"
|
confirmation_code: "Introduce el código que has recibido en tu carta"
|
||||||
update:
|
update:
|
||||||
error: "Código de verificación incorrecto"
|
|
||||||
flash:
|
flash:
|
||||||
success: "Código correcto. Tu cuenta ya está verificada"
|
success: "Código correcto. Tu cuenta ya está verificada"
|
||||||
alert:
|
alert:
|
||||||
unconfirmed_code: "Todavía no has introducido el código de confirmación"
|
unconfirmed_code: "Todavía no has introducido el código de confirmación"
|
||||||
|
<<<<<<< HEAD
|
||||||
verify_attemps_left: "Has llegado al máximo número de intentos de verificar tu carta."
|
verify_attemps_left: "Has llegado al máximo número de intentos de verificar tu carta."
|
||||||
|
=======
|
||||||
|
errors:
|
||||||
|
letter_not_sent: "Aún no te hemos enviado la carta con el código"
|
||||||
|
incorect_code: "Código de verificación incorrecto"
|
||||||
|
address_not_found: "No se ha encontrado una dirección"
|
||||||
|
>>>>>>> adds validation error for letter verification code [#395]
|
||||||
verified_user:
|
verified_user:
|
||||||
show:
|
show:
|
||||||
title: "Información disponible"
|
title: "Información disponible"
|
||||||
|
|||||||
Reference in New Issue
Block a user