use atom key for fields
authorSadposter <hannah+pleroma@coffee-and-dreams.uk>
Mon, 2 Sep 2019 11:31:23 +0000 (12:31 +0100)
committerSadposter <hannah+pleroma@coffee-and-dreams.uk>
Mon, 2 Sep 2019 11:31:23 +0000 (12:31 +0100)
lib/pleroma/user/info.ex

index ca1282d02beb518435f0059e2113ce6879e93381..151e025de8bf98f1e9da6af1844a505a74cb3019 100644 (file)
@@ -242,7 +242,12 @@ defmodule Pleroma.User.Info do
   end
 
   def remote_user_creation(info, params) do
-    params = Map.put(params, "fields", Enum.map(params["fields"], &truncate_field/1))
+    params =
+      if Map.has_key?(params, :fields) do
+        Map.put(params, :fields, Enum.map(params[:fields], &truncate_field/1))
+      else
+        params
+      end
 
     info
     |> cast(params, [