FIX: Don't try to create a reviewable user twice
This commit is contained in:
parent
331a809738
commit
d21dd521d2
|
@ -29,5 +29,7 @@ class Jobs::CreateUserReviewable < Jobs::Base
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rescue ActiveRecord::RecordNotUnique
|
||||||
|
# If the reviewable is somehow queued twice, we can ignore.
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,12 @@ describe Jobs::CreateUserReviewable do
|
||||||
expect(reviewable.payload['email']).to eq(user.email)
|
expect(reviewable.payload['email']).to eq(user.email)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should not raise an error if there is a reviewable already" do
|
||||||
|
SiteSetting.must_approve_users = true
|
||||||
|
described_class.new.execute(user_id: user.id)
|
||||||
|
described_class.new.execute(user_id: user.id)
|
||||||
|
end
|
||||||
|
|
||||||
describe "reasons" do
|
describe "reasons" do
|
||||||
it "does nothing if there's no reason" do
|
it "does nothing if there's no reason" do
|
||||||
described_class.new.execute(user_id: user.id)
|
described_class.new.execute(user_id: user.id)
|
||||||
|
|
Loading…
Reference in New Issue