mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 05:36:22 +00:00
fix: efectivamente ignorar mails que ya son usuaries de este sitio
This commit is contained in:
parent
f8b57c8a2b
commit
72c6c3dcd2
1 changed files with 2 additions and 2 deletions
|
@ -84,11 +84,11 @@ class UsuariesController < ApplicationController
|
|||
invitaciones.each do |invitacion|
|
||||
attributes = { email: invitacion.address }
|
||||
|
||||
next if Usuarie.where(id: @site.roles.pluck(:usuarie_id)).find_by(attributes)
|
||||
|
||||
usuarie = Usuarie.find_by attributes
|
||||
usuarie ||= Usuarie.invite! attributes
|
||||
|
||||
next if usuarie.sites.exists? @site.id
|
||||
|
||||
@site.roles.create(usuarie: usuarie, temporal: true, rol: invited_as)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue