FIX: Don't fail seed if avatar can't be downloaded

This commit is contained in:
Robin Ward 2017-06-09 11:01:48 -04:00
parent 5ff986129a
commit d8ba1c66d5
1 changed files with 9 additions and 5 deletions

View File

@ -18,11 +18,15 @@ if !user
# TODO Pull the user avatar from that thread for now. In the future, pull it from a local file or from some central discobot repo. # TODO Pull the user avatar from that thread for now. In the future, pull it from a local file or from some central discobot repo.
if !Rails.env.test? if !Rails.env.test?
UserAvatar.import_url_for_user( begin
"https://cdn.discourse.org/dev/uploads/default/original/2X/e/edb63d57a720838a7ce6a68f02ba4618787f2299.png", UserAvatar.import_url_for_user(
User.find(-2), "https://cdn.discourse.org/dev/uploads/default/original/2X/e/edb63d57a720838a7ce6a68f02ba4618787f2299.png",
override_gravatar: true User.find(-2),
) override_gravatar: true
)
rescue
# In case the avatar can't be downloaded, don't fail seed
end
end end
end end