5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 04:31:41 +00:00

fix: aceptar la invitación también confirma el correo #13247
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

les usuaries que no confirmaron su correo quedaban en un loop si luego
eran invitades a un sitio.
This commit is contained in:
f 2023-04-24 17:21:24 -03:00
parent 1cf5ca5953
commit 5c467e08b8
3 changed files with 8 additions and 2 deletions

View file

@ -50,6 +50,12 @@ class Usuarie < ApplicationRecord
end
end
# Les usuaries necesitan link de invitación si no tenían cuenta
# o todavía no la confirmaron
def needs_invitation_link?
(created_by_invite? && !invitation_accepted?) || !confirmed?
end
private
def lang_from_locale!

View file

@ -8,7 +8,7 @@
%h1= site.title
%p= site.description
- if @resource.created_by_invite? && !@resource.invitation_accepted?
- if @resource.needs_invitation_link?
%p= link_to t('devise.mailer.invitation_instructions.accept'),
accept_invitation_url(@resource, invitation_token: @token, change_locale_to: @resource.lang)

View file

@ -9,7 +9,7 @@
\
= site.description
\
- if @resource.created_by_invite? && !@resource.invitation_accepted?
- if @resource.needs_invitation_link?
= accept_invitation_url(@resource, invitation_token: @token, change_locale_to: @resource.lang)
\
- if @resource.invitation_due_at