Skip to content

Commit

Permalink
fix: Allow user to change his email whatever the email status is
Browse files Browse the repository at this point in the history
fixes #1043
  • Loading branch information
kumy committed Aug 24, 2024
1 parent c82235c commit 48d0bfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/unit/app/GeoKrety/Emails/EmailChangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static function emailStatusProvider(): array {
[User::USER_EMAIL_NO_ERROR, 1],
[User::USER_EMAIL_DOES_NOT_EXIST, 1],
[User::USER_EMAIL_UNCONFIRMED, 1],
[User::USER_EMAIL_MISSING, 0],
[User::USER_EMAIL_MISSING, 1],
[User::USER_EMAIL_MAILBOX_FULL, 1],
[User::USER_EMAIL_DETECTED_AS_SPAM, 1],
];
Expand Down
3 changes: 2 additions & 1 deletion website/app/GeoKrety/Email/EmailChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ protected function setFromDefault() {
}

protected function allowSend(User $user): bool {
return $user->isEmailValidForAdminTask();
// Allow user to change their mail address, whatever the status is
return true;
}

protected function allowNonProdEnvSend(): bool {
Expand Down

0 comments on commit 48d0bfb

Please sign in to comment.