FIX: If the user can't be found to award a badge, skip them
This commit is contained in:
parent
976056bc41
commit
a26bd2c549
|
@ -30,7 +30,8 @@ module Jobs
|
||||||
|
|
||||||
badge = Badge.find(Badge::FirstOnebox)
|
badge = Badge.find(Badge::FirstOnebox)
|
||||||
to_award.each do |user_id, opts|
|
to_award.each do |user_id, opts|
|
||||||
BadgeGranter.grant(badge, User.find(user_id), opts)
|
user = User.where(id: user_id).first
|
||||||
|
BadgeGranter.grant(badge, user, opts) if user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue