diff options
author | lambda <pleromagit@rogerbraun.net> | 2018-12-17 20:16:15 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2018-12-17 20:16:15 +0000 |
commit | 3d980daa49e51c7e3ec1f019e2b68c8108b37c76 (patch) | |
tree | d72445988d7caf20af6fb4a12b6d1ed731228024 /lib | |
parent | ebbe11f33b62cb248170ba25e5c9cd2e5b339b3a (diff) | |
parent | cc878804880137740afc37a0c5d3f7e4d64d014a (diff) | |
download | pleroma-3d980daa49e51c7e3ec1f019e2b68c8108b37c76.tar.gz |
Merge branch '459_fix_user_profile_crash' into 'develop'
Fix update_profile failing due to OAuth token record in assigns instead of string
Closes #459
See merge request pleroma/pleroma!561
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/twitter_api/views/user_view.ex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/web/twitter_api/views/user_view.ex b/lib/pleroma/web/twitter_api/views/user_view.ex index b3459af9a..8a88d72b1 100644 --- a/lib/pleroma/web/twitter_api/views/user_view.ex +++ b/lib/pleroma/web/twitter_api/views/user_view.ex @@ -86,7 +86,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do } if assigns[:token] do - Map.put(data, "token", assigns[:token]) + Map.put(data, "token", token_string(assigns[:token])) else data end @@ -111,4 +111,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do defp image_url(%{"url" => [%{"href" => href} | _]}), do: href defp image_url(_), do: nil + + defp token_string(%Pleroma.Web.OAuth.Token{token: token_str}), do: token_str + defp token_string(token), do: token end |