diff --git a/lib/web/upload/upload.ex b/lib/web/upload/upload.ex index 9b7f1db94..5e19cec7f 100644 --- a/lib/web/upload/upload.ex +++ b/lib/web/upload/upload.ex @@ -69,7 +69,10 @@ defmodule Mobilizon.Web.Upload do opts = get_opts(opts) with {:ok, upload} <- prepare_upload(upload, opts), - upload = %__MODULE__{upload | path: upload.path || "#{upload.id}/#{upload.name}"}, + %__MODULE__{} = upload <- %__MODULE__{ + upload + | path: upload.path || "#{upload.id}/#{upload.name}" + }, {:ok, upload} <- Filter.filter(opts.filters, upload), {:ok, url_spec} <- Uploader.put_file(opts.uploader, upload) do {:ok,