FIX: Don't add the reviewable score twice
This commit is contained in:
parent
21b975e71a
commit
70097966ed
|
@ -23,6 +23,8 @@ class Jobs::CreateUserReviewable < Jobs::Base
|
|||
email: user.email
|
||||
}
|
||||
)
|
||||
return if @reviewable.score > 0
|
||||
|
||||
@reviewable.add_score(
|
||||
Discourse.system_user,
|
||||
ReviewableScore.types[:needs_approval],
|
||||
|
|
|
@ -21,6 +21,9 @@ describe Jobs::CreateUserReviewable do
|
|||
SiteSetting.must_approve_users = true
|
||||
described_class.new.execute(user_id: user.id)
|
||||
described_class.new.execute(user_id: user.id)
|
||||
|
||||
reviewable = Reviewable.find_by(target: user)
|
||||
expect(reviewable.reviewable_scores.size).to eq(1)
|
||||
end
|
||||
|
||||
describe "reasons" do
|
||||
|
|
Loading…
Reference in New Issue