gearheads
/
mastodon
Archived
2
0
Fork 0

Try to avoid any potential loops

gh/stable
Eugen 2017-01-19 02:14:57 +01:00 committed by GitHub
parent 306eb6e9c9
commit 8b9206f7d9
1 changed files with 3 additions and 7 deletions

View File

@ -125,13 +125,9 @@ class Account < ApplicationRecord
def save_with_optional_avatar!
save!
rescue ActiveRecord::RecordInvalid => invalid
if invalid.record.errors[:avatar_file_size] || invalid.record.errors[:avatar_content_type]
rescue ActiveRecord::RecordInvalid
self.avatar = nil
retry
end
raise invalid
save!
end
def avatar_remote_url=(url)