[#114] Formatting fix.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Tue, 18 Dec 2018 14:30:30 +0000 (17:30 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Tue, 18 Dec 2018 14:30:30 +0000 (17:30 +0300)
lib/pleroma/web/twitter_api/twitter_api.ex

index d8dd7dfa85eec650df08850145ef37af93b2100b..d816dc3bca9563eb6ea321f83835bd0f05372d0f 100644 (file)
@@ -161,19 +161,19 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
           Repo.get_by(UserInviteToken, %{token: tokenString})
         end
 
-    cond do
-      registrations_open || (!is_nil(token) && !token.used) ->
-        changeset = User.register_changeset(%User{}, params)
-
-        with {:ok, user} <- User.register(changeset) do
-          !registrations_open && UserInviteToken.mark_as_used(token.token)
-
-          {:ok, user}
-        else
-          {:error, changeset} ->
-            errors =
-              Ecto.Changeset.traverse_errors(changeset, fn {msg, _opts} -> msg end)
-              |> Jason.encode!()
+      cond do
+        registrations_open || (!is_nil(token) && !token.used) ->
+          changeset = User.register_changeset(%User{}, params)
+
+          with {:ok, user} <- User.register(changeset) do
+            !registrations_open && UserInviteToken.mark_as_used(token.token)
+
+            {:ok, user}
+          else
+            {:error, changeset} ->
+              errors =
+                Ecto.Changeset.traverse_errors(changeset, fn {msg, _opts} -> msg end)
+                |> Jason.encode!()
 
               {:error, %{error: errors}}
           end