mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 04:15:58 +08:00
FIX: Don't fail seed if avatar can't be downloaded
This commit is contained in:
parent
5d04cb4b47
commit
e3bfcbc7c9
|
@ -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.
|
||||
if !Rails.env.test?
|
||||
UserAvatar.import_url_for_user(
|
||||
"https://cdn.discourse.org/dev/uploads/default/original/2X/e/edb63d57a720838a7ce6a68f02ba4618787f2299.png",
|
||||
User.find(-2),
|
||||
override_gravatar: true
|
||||
)
|
||||
begin
|
||||
UserAvatar.import_url_for_user(
|
||||
"https://cdn.discourse.org/dev/uploads/default/original/2X/e/edb63d57a720838a7ce6a68f02ba4618787f2299.png",
|
||||
User.find(-2),
|
||||
override_gravatar: true
|
||||
)
|
||||
rescue
|
||||
# In case the avatar can't be downloaded, don't fail seed
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user