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

@ -221,6 +221,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
user
|> UserEmail.password_reset_email(token_record.token)
|> Mailer.deliver_async()
{:ok, :enqueued}
else
false ->
{:error, "bad user identifier"}