about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-23 16:39:22 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-08-23 16:39:22 +0200
commit63484ee17a857ad0c4c33f196bfa8d825621c509 (patch)
treeb244da66ae28858a8a782baca17a491371126ec1
parent6cb3514d64ec24b164484f4eb84363b96746d5d6 (diff)
Do not check for file existence when serializing ActivityPub actor (#8386)
When serializing an ActivityPub actor, Mastodon checks for the existence
of the avatar/header files. This is not necessary, only check if avatar/header
is set.

https://github.com/thoughtbot/paperclip/blob/fd8bf49d3895de2904b43f95d11af0736fbd0f5b/README.md#checking-a-file-exists
-rw-r--r--app/serializers/activitypub/actor_serializer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb
index 41c9aa44e..5054bd683 100644
--- a/app/serializers/activitypub/actor_serializer.rb
+++ b/app/serializers/activitypub/actor_serializer.rb
@@ -93,11 +93,11 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
   end
 
   def avatar_exists?
-    object.avatar.exists?
+    object.avatar?
   end
 
   def header_exists?
-    object.header.exists?
+    object.header?
   end
 
   def manually_approves_followers