Browse Source

User form unique email fix

master
Egorka 7 years ago
parent
commit
56ab293f45
  1. 3
      core/forms/user/UserForm.php

3
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],
];
}

Loading…
Cancel
Save