projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request 'Update OpenBSD docs' (#414) from lechindianer/akkoma:update-openb...
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
controllers
/
app_controller.ex
diff --git
a/lib/pleroma/web/mastodon_api/controllers/app_controller.ex
b/lib/pleroma/web/mastodon_api/controllers/app_controller.ex
index 8d18140add66b39d3881ce081cb5ed5dfaae843b..499ccf056d0470e8b39eb561e857c0b92d48374d 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/controllers/app_controller.ex
+++ b/
lib/pleroma/web/mastodon_api/controllers/app_controller.ex
@@
-23,6
+23,8
@@
defmodule Pleroma.Web.MastodonAPI.AppController do
plug(Pleroma.Web.ApiSpec.CastAndValidate)
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"
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.AppOperation
@doc "POST /api/v1/apps"
@@
-37,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),
|> 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
{:ok, app} <- Repo.insert(cs) do
render(conn, "show.json", app: app)
end