mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Try to avoid any potential loops
This commit is contained in:
parent
306eb6e9c9
commit
8b9206f7d9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user