diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2021-10-06 05:44:44 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2021-10-06 05:44:44 +0000 |
commit | 92a8ff59aa7f81e2463775669ada54f618d8c684 (patch) | |
tree | da28b718d958b9835383eb94a4a712a4e92a3844 /lib | |
parent | d2d462748c4ad03857b05694ba234bb651258e38 (diff) | |
parent | 198250dcef9b477912567932a714a6ecf37f8353 (diff) | |
download | pleroma-92a8ff59aa7f81e2463775669ada54f618d8c684.tar.gz pleroma-92a8ff59aa7f81e2463775669ada54f618d8c684.zip |
Merge branch 'from/develop/tusooa/add-remove-emails' into 'develop'
Allow users to remove their emails if instance does not need email to register
See merge request pleroma/pleroma!3522
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/operations/twitter_util_operation.ex | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 455e08c88..3b4e49176 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -2246,7 +2246,7 @@ defmodule Pleroma.User do def change_email(user, email) do user |> cast(%{email: email}, [:email]) - |> validate_required([:email]) + |> maybe_validate_required_email(false) |> unique_constraint(:email) |> validate_format(:email, @email_regex) |> update_and_set_cache() diff --git a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex index 879b2227e..ebcfd3be2 100644 --- a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex +++ b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex @@ -121,7 +121,10 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do type: :object, required: [:email, :password], properties: %{ - email: %Schema{type: :string, description: "New email"}, + email: %Schema{ + type: :string, + description: "New email. Set to blank to remove the user's email." + }, password: %Schema{type: :string, description: "Current password"} } } |