mirror of
https://github.com/elyby/accounts.git
synced 2024-12-27 15:40:21 +05:30
Фикс ошибки в форме смены ника, когда старый ник перезатирался на этапе валидации
This commit is contained in:
parent
69ffb9fd9a
commit
c828b8e1e6
@ -6,6 +6,7 @@ use api\models\base\ApiForm;
|
||||
use api\validators\PasswordRequiredValidator;
|
||||
use common\helpers\Error;
|
||||
use common\helpers\Amqp;
|
||||
use common\models\Account;
|
||||
use common\models\amqp\UsernameChanged;
|
||||
use common\models\UsernameHistory;
|
||||
use Exception;
|
||||
@ -28,7 +29,7 @@ class ChangeUsernameForm extends ApiForm {
|
||||
}
|
||||
|
||||
public function validateUsername($attribute) {
|
||||
$account = $this->getAccount();
|
||||
$account = new Account();
|
||||
$account->username = $this->$attribute;
|
||||
if (!$account->validate(['username'])) {
|
||||
$this->addErrors($account->getErrors());
|
||||
|
Loading…
Reference in New Issue
Block a user