remote user deactivation: fix test failures
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 19 May 2018 03:17:56 +0000 (22:17 -0500)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 19 May 2018 06:26:13 +0000 (01:26 -0500)
lib/pleroma/web/activity_pub/activity_pub.ex

index 76cda0b4cab10db2d0e983b9bf0e407211c6d3b6..c026f2427fa7d29002d137418611b9cb612eb38c 100644 (file)
@@ -17,10 +17,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
   end
 
   defp check_actor_is_active(actor) do
-    user = User.get_cached_by_ap_id(actor)
-
-    if user.info["deactivated"] == true do
-      :reject
+    if not is_nil(actor) do
+      with user <- User.get_cached_by_ap_id(actor),
+           nil <- user.info["deactivated"] do
+        :ok
+      else
+        _e -> :reject
+      end
     else
       :ok
     end