Fix password reset for non-test env

Fixes `Plug.Conn.NotSentError` that causes a 5xx error in response
instead of 404 and 400.

Fixes pattern matching error caused by different response format
in test and non-test env: `Pleroma.Emails.Mailer.deliver_async` returns
:ok when PleromaJobQueue is enabled and `{:ok, _}` when it's disabled.
In tests, it's disabled.
This commit is contained in:
Eugenij 2019-07-17 18:09:31 +00:00 committed by kaniini
commit 4bf2bb9cff
5 changed files with 10 additions and 8 deletions

View file

@ -1826,10 +1826,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|> json("")
else
{:error, "unknown user"} ->
put_status(conn, :not_found)
send_resp(conn, :not_found, "")
{:error, _} ->
put_status(conn, :bad_request)
send_resp(conn, :bad_request, "")
end
end