diff --git a/core/forms/user/UserForm.php b/core/forms/user/UserForm.php index e40f190..0f11fc4 100644 --- a/core/forms/user/UserForm.php +++ b/core/forms/user/UserForm.php @@ -34,7 +34,8 @@ class UserForm extends Model [['username', 'email', 'role'], 'required'], ['email', 'email'], ['email', 'string', 'max' => 255], - [['username', 'email'], 'unique', 'targetClass' => User::class, 'filter' => ['<>', 'id', $this->_user->id]], + //[['username', 'email'], 'unique', 'targetClass' => User::class, 'filter' => ['<>', 'id', $this->_user->id]], + [['username', 'email'], 'unique', 'targetClass' => User::class, 'filter' => isset($this->_user->id) ? ['<>', 'id', $this->_user->id] : null ], ['password', 'string', 'min' => 6], ]; }