Commit 8b9206f7 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub

Try to avoid any potential loops

parent 306eb6e9
......@@ -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]
self.avatar = nil
retry
end
raise invalid
rescue ActiveRecord::RecordInvalid
self.avatar = nil
save!
end
def avatar_remote_url=(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment