Apply suggestion to lib/pleroma/delivery.ex
authorrinpatch <rinpatch@sdf.org>
Fri, 13 Sep 2019 15:23:26 +0000 (15:23 +0000)
committerrinpatch <rinpatch@sdf.org>
Fri, 13 Sep 2019 15:23:26 +0000 (15:23 +0000)
lib/pleroma/delivery.ex

index ce8fb96f40dbc09cb0955c69dc553b20ea96fab4..38c148c345c470025958b84c3b79667bf47f434e 100644 (file)
@@ -31,7 +31,7 @@ defmodule Pleroma.Delivery do
   def create(object_id, user_id) do
     %Delivery{}
     |> changeset(%{user_id: user_id, object_id: object_id})
-    |> Repo.insert()
+    |> Repo.insert(on_conflict: :nothing)
   end
 
   def get(object_id, user_id) do