Skip to content

Commit 2cd9f97

Browse files
author
Roman Lytvynenko
committed
MAGETWO-99493: Account lock status not showing correctly in Customer Grid
1 parent e77d295 commit 2cd9f97

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/code/Magento/Customer/Model/CustomerAuthUpdate.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,23 @@ public function saveAuth($customerId)
5656
{
5757
$customerSecure = $this->customerRegistry->retrieveSecureData($customerId);
5858

59+
$this->customerResourceModel->load($this->customerModel, $customerId);
60+
$currentLockExpiresVal = $this->customerModel->getData('lock_expires');
61+
$newLockExpiresVal = $customerSecure->getData('lock_expires');
62+
5963
$this->customerResourceModel->getConnection()->update(
6064
$this->customerResourceModel->getTable('customer_entity'),
6165
[
6266
'failures_num' => $customerSecure->getData('failures_num'),
6367
'first_failure' => $customerSecure->getData('first_failure'),
64-
'lock_expires' => $customerSecure->getData('lock_expires'),
68+
'lock_expires' => $newLockExpiresVal,
6569
],
6670
$this->customerResourceModel->getConnection()->quoteInto('entity_id = ?', $customerId)
6771
);
6872

69-
$this->customerResourceModel->load($this->customerModel, $customerId);
70-
$this->customerModel->reindex();
73+
if ($currentLockExpiresVal !== $newLockExpiresVal) {
74+
$this->customerModel->reindex();
75+
}
7176

7277
return $this;
7378
}

0 commit comments

Comments
 (0)