Fix task name for robotstxt
[akkoma] / lib / pleroma / web / mastodon_api / controllers / app_controller.ex
index ef7331bf3c14dd5dbf4b9b49a39f939c1dfe1f0b..499ccf056d0470e8b39eb561e857c0b92d48374d 100644 (file)
@@ -17,14 +17,14 @@ defmodule Pleroma.Web.MastodonAPI.AppController do
   alias Pleroma.Web.OAuth.Scopes
   alias Pleroma.Web.OAuth.Token
 
-  require Logger
-
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
 
   plug(:skip_auth when action in [:create, :verify_credentials])
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
+  @local_mastodon_name "Mastodon-Local"
+
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.AppOperation
 
   @doc "POST /api/v1/apps"
@@ -39,6 +39,7 @@ defmodule Pleroma.Web.MastodonAPI.AppController do
       |> Maps.put_if_present(:user_id, user_id)
 
     with cs <- App.register_changeset(%App{}, app_attrs),
+         false <- cs.changes[:client_name] == @local_mastodon_name,
          {:ok, app} <- Repo.insert(cs) do
       render(conn, "show.json", app: app)
     end