Commit 3d980daa authored by lain's avatar lain
Browse files

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 !561
parents ebbe11f3 cc878804
Pipeline #5495 passed with stages
in 3 minutes and 6 seconds
...@@ -86,7 +86,7 @@ def render("user.json", %{user: user = %User{}} = assigns) do ...@@ -86,7 +86,7 @@ def render("user.json", %{user: user = %User{}} = assigns) do
} }
if assigns[:token] do if assigns[:token] do
Map.put(data, "token", assigns[:token]) Map.put(data, "token", token_string(assigns[:token]))
else else
data data
end end
...@@ -111,4 +111,7 @@ def render("short.json", %{ ...@@ -111,4 +111,7 @@ def render("short.json", %{
defp image_url(%{"url" => [%{"href" => href} | _]}), do: href defp image_url(%{"url" => [%{"href" => href} | _]}), do: href
defp image_url(_), do: nil 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 end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment