diff --git a/app/models/invite.rb b/app/models/invite.rb index 54b8131a763..fdeb76e0dfc 100644 --- a/app/models/invite.rb +++ b/app/models/invite.rb @@ -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