From: lain Date: Sat, 1 Dec 2018 08:55:46 +0000 (+0100) Subject: Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into validate-user-info X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c443c9bd72b04b8a24d904bc20fde0d4ffca71d7;p=akkoma Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into validate-user-info --- c443c9bd72b04b8a24d904bc20fde0d4ffca71d7 diff --cc lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 3a49a96a1,009be50e7..f209bb43c --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@@ -71,34 -63,34 +63,34 @@@ defmodule Pleroma.Web.MastodonAPI.Masto user end - user = - if banner = params["header"] do - with %Plug.Upload{} <- banner, - {:ok, object} <- ActivityPub.upload(banner, type: :banner), - new_info <- Map.put(user.info, "banner", object.data), - change <- User.info_changeset(user, %{info: new_info}), - {:ok, user} <- User.update_and_set_cache(change) do - user - else - _e -> user - end - else - user - end - - user = - if locked = params["locked"] do - with locked <- locked == "true", - new_info <- Map.put(user.info, "locked", locked), - change <- User.info_changeset(user, %{info: new_info}), - {:ok, user} <- User.update_and_set_cache(change) do - user - else - _e -> user - end - else - user - end + # user = + # if banner = params["header"] do + # with %Plug.Upload{} <- banner, - # {:ok, object} <- ActivityPub.upload(banner, banner_upload_limit), ++ # {:ok, object} <- ActivityPub.upload(banner, type: :banner), + # new_info <- Map.put(user.info, "banner", object.data), + # change <- User.info_changeset(user, %{info: new_info}), + # {:ok, user} <- User.update_and_set_cache(change) do + # user + # else + # _e -> user + # end + # else + # user + # end + + # user = + # if locked = params["locked"] do + # with locked <- locked == "true", + # new_info <- Map.put(user.info, "locked", locked), + # change <- User.info_changeset(user, %{info: new_info}), + # {:ok, user} <- User.update_and_set_cache(change) do + # user + # else + # _e -> user + # end + # else + # user + # end with changeset <- User.update_changeset(user, params), {:ok, user} <- User.update_and_set_cache(changeset) do