add scrutinizer suggestion
This commit is contained in:
@ -122,6 +122,7 @@ class SettingsForm extends Model
|
|||||||
{
|
{
|
||||||
if ($this->validate()) {
|
if ($this->validate()) {
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
if ($user instanceof User) {
|
||||||
$user->scenario = 'settings';
|
$user->scenario = 'settings';
|
||||||
$user->username = $this->username;
|
$user->username = $this->username;
|
||||||
$user->password = $this->new_password;
|
$user->password = $this->new_password;
|
||||||
@ -138,6 +139,7 @@ class SettingsForm extends Model
|
|||||||
|
|
||||||
return $user->save();
|
return $user->save();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user