Apply suggestion to lib/pleroma/web/activity_pub/activity_pub_controller.ex
authorrinpatch <rinpatch@sdf.org>
Fri, 13 Sep 2019 10:09:56 +0000 (10:09 +0000)
committerrinpatch <rinpatch@sdf.org>
Fri, 13 Sep 2019 10:09:56 +0000 (10:09 +0000)
lib/pleroma/web/activity_pub/activity_pub_controller.ex

index 0256417228cc7411dce90aa9b4ad6ed0d92c94f1..4bd13defbd7bed4466156c41e9fa92e323c2dce3 100644 (file)
@@ -72,9 +72,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
   end
 
   def track_object_fetch(conn, object_id) do
-    case conn.assigns[:user] do
-      %User{id: user_id} -> Delivery.create(object_id, user_id)
-      _ -> nil
+    with %{assigns: %{user: %User{id: user_id}}} <- conn do
+      Delivery.create(object_id, user_id)
     end
 
     conn