mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-22 04:01:47 +00:00
fix: aceptar la invitación también confirma el correo #13247
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
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:
parent
1cf5ca5953
commit
5c467e08b8
3 changed files with 8 additions and 2 deletions
|
@ -50,6 +50,12 @@ class Usuarie < ApplicationRecord
|
||||||
end
|
end
|
||||||
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
|
private
|
||||||
|
|
||||||
def lang_from_locale!
|
def lang_from_locale!
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
%h1= site.title
|
%h1= site.title
|
||||||
%p= site.description
|
%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'),
|
%p= link_to t('devise.mailer.invitation_instructions.accept'),
|
||||||
accept_invitation_url(@resource, invitation_token: @token, change_locale_to: @resource.lang)
|
accept_invitation_url(@resource, invitation_token: @token, change_locale_to: @resource.lang)
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
\
|
\
|
||||||
= site.description
|
= 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)
|
= accept_invitation_url(@resource, invitation_token: @token, change_locale_to: @resource.lang)
|
||||||
\
|
\
|
||||||
- if @resource.invitation_due_at
|
- if @resource.invitation_due_at
|
||||||
|
|
Loading…
Reference in a new issue