Upload pictures fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-07-04 17:41:06 +02:00
parent 2749989a28
commit d609ccfb51
3 changed files with 9 additions and 3 deletions

View File

@@ -208,7 +208,7 @@ defmodule Mobilizon.Service.ActivityPub.Utils do
@doc """
Save picture data from raw data and return AS Link data.
"""
def make_picture_data(%{picture: picture}) do
def make_picture_data(picture) when is_map(picture) do
with {:ok, %{"url" => [%{"href" => url, "mediaType" => content_type}], "size" => size}} <-
MobilizonWeb.Upload.store(picture.file),
{:ok, %Picture{file: _file} = pic} <-