projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/reports' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
twitter_api
/
twitter_api.ex
diff --git
a/lib/pleroma/web/twitter_api/twitter_api.ex
b/lib/pleroma/web/twitter_api/twitter_api.ex
index 162beb9be06b7ffb7f95b51efb434ed3d5d1871a..efdd0bf435ed853fd5d4640d6d4b0da02a340fc2 100644
(file)
--- a/
lib/pleroma/web/twitter_api/twitter_api.ex
+++ b/
lib/pleroma/web/twitter_api/twitter_api.ex
@@
-216,7
+216,7
@@
defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
{:ok, token_record} <- Pleroma.PasswordResetToken.create_token(user) do
user
|> UserEmail.password_reset_email(token_record.token)
{:ok, token_record} <- Pleroma.PasswordResetToken.create_token(user) do
user
|> UserEmail.password_reset_email(token_record.token)
- |> Mailer.deliver()
+ |> Mailer.deliver
_async
()
else
false ->
{:error, "bad user identifier"}
else
false ->
{:error, "bad user identifier"}
@@
-310,8
+310,16
@@
defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
else
_e ->
changeset = Object.context_mapping(context)
else
_e ->
changeset = Object.context_mapping(context)
- {:ok, object} = Object.insert_or_get(changeset)
- object.id
+
+ case Repo.insert(changeset) do
+ {:ok, %{id: id}} ->
+ id
+
+ # This should be solved by an upsert, but it seems ecto
+ # has problems accessing the constraint inside the jsonb.
+ {:error, _} ->
+ Object.get_cached_by_ap_id(context).id
+ end
end
end
end
end