File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
app/code/Magento/Newsletter/Controller/Subscriber
dev/tests/integration/testsuite/Magento/Newsletter/Controller Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,9 @@ public function __construct(
80
80
protected function validateEmailAvailable ($ email )
81
81
{
82
82
$ websiteId = $ this ->_storeManager ->getStore ()->getWebsiteId ();
83
- if ($ this ->_customerSession ->getCustomerDataObject ()->getEmail () !== $ email
84
- && !$ this ->customerAccountManagement ->isEmailAvailable ($ email , $ websiteId )
83
+ if ($ this ->_customerSession ->isLoggedIn ()
84
+ && ($ this ->_customerSession ->getCustomerDataObject ()->getEmail () !== $ email
85
+ && !$ this ->customerAccountManagement ->isEmailAvailable ($ email , $ websiteId ))
85
86
) {
86
87
throw new LocalizedException (
87
88
__ ('This email address is already assigned to another user. ' )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function testNewActionUsedEmail()
57
57
$ this ->dispatch ('newsletter/subscriber/new ' );
58
58
59
59
$ this ->assertSessionMessages ($ this ->equalTo ([
60
- 'This email address is already assigned to another user . ' ,
60
+ 'Thank you for your subscription . ' ,
61
61
]));
62
62
$ this ->assertRedirect ($ this ->anything ());
63
63
}
You can’t perform that action at this time.
0 commit comments