Merge branch 'remake-remodel-2' of git.pleroma.social:pleroma/pleroma into remake...
[akkoma] / lib / pleroma / web / activity_pub / object_validators / common_validations.ex
index db0e2072dbd53198b875ab034a4afce9835e03a1..b479c391837f1ccf20dfabd5134b562054e4dbb8 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations do
@@ -21,11 +21,11 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations do
 
   def validate_object_presence(cng, field_name \\ :object) do
     cng
-    |> validate_change(field_name, fn field_name, actor ->
-      if Object.get_cached_by_ap_id(actor) do
+    |> validate_change(field_name, fn field_name, object ->
+      if Object.get_cached_by_ap_id(object) do
         []
       else
-        [{field_name, "can't find user"}]
+        [{field_name, "can't find object"}]
       end
     end)
   end