FIX: If the invite with topic id already exists, redirect user to home page instead
This commit is contained in:
parent
f43293a7bc
commit
c14a35f173
|
@ -172,7 +172,7 @@ class Invite < ActiveRecord::Base
|
|||
invite = Invite.find_by(invite_key: token)
|
||||
if invite
|
||||
invite.update_column(:email, email)
|
||||
invite.topic_invites.create!(invite_id: invite.id, topic_id: topic_id) if topic_id && Topic.find_by_id(topic_id)
|
||||
invite.topic_invites.create!(invite_id: invite.id, topic_id: topic_id) if topic_id && Topic.find_by_id(topic_id) && !invite.topic_invites.pluck(:topic_id).include?(topic_id)
|
||||
user = InviteRedeemer.new(invite, username, name).redeem
|
||||
end
|
||||
user
|
||||
|
|
Loading…
Reference in New Issue