Merge pull request #2549 from techAPJ/patch-3
FIX: If the invite with topic id already exists, redirect user to home p...
This commit is contained in:
commit
19d1a9c96b
|
@ -172,7 +172,7 @@ class Invite < ActiveRecord::Base
|
||||||
invite = Invite.find_by(invite_key: token)
|
invite = Invite.find_by(invite_key: token)
|
||||||
if invite
|
if invite
|
||||||
invite.update_column(:email, email)
|
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
|
user = InviteRedeemer.new(invite, username, name).redeem
|
||||||
end
|
end
|
||||||
user
|
user
|
||||||
|
|
Loading…
Reference in New Issue