Fix password reset for non-test env
authorEugenij <eugenijm@protonmail.com>
Wed, 17 Jul 2019 18:09:31 +0000 (18:09 +0000)
committerkaniini <ariadne@dereferenced.org>
Wed, 17 Jul 2019 18:09:31 +0000 (18:09 +0000)
commit4bf2bb9cff2d263e1b022f5c40128ffcbd372746
treee3c37dfbd7e915e87d6a6e893959c3dfd037c5c2
parentce73d5f6a53826c85e46bbe45835b99ceaab67cd
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.
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/twitter_api/twitter_api.ex
lib/pleroma/web/twitter_api/twitter_api_controller.ex
test/web/mastodon_api/mastodon_api_controller_test.exs
test/web/twitter_api/twitter_api_controller_test.exs