mirror of
https://github.com/elyby/accounts.git
synced 2024-12-29 00:20:22 +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 api\validators\PasswordRequiredValidator;
|
||||||
use common\helpers\Error;
|
use common\helpers\Error;
|
||||||
use common\helpers\Amqp;
|
use common\helpers\Amqp;
|
||||||
|
use common\models\Account;
|
||||||
use common\models\amqp\UsernameChanged;
|
use common\models\amqp\UsernameChanged;
|
||||||
use common\models\UsernameHistory;
|
use common\models\UsernameHistory;
|
||||||
use Exception;
|
use Exception;
|
||||||
@ -28,7 +29,7 @@ class ChangeUsernameForm extends ApiForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function validateUsername($attribute) {
|
public function validateUsername($attribute) {
|
||||||
$account = $this->getAccount();
|
$account = new Account();
|
||||||
$account->username = $this->$attribute;
|
$account->username = $this->$attribute;
|
||||||
if (!$account->validate(['username'])) {
|
if (!$account->validate(['username'])) {
|
||||||
$this->addErrors($account->getErrors());
|
$this->addErrors($account->getErrors());
|
||||||
|
Loading…
Reference in New Issue
Block a user