Fix updating of user visibility (#5851)

This commit is contained in:
Yuriy Bakhtin 2022-08-24 23:43:30 +03:00 committed by GitHub
parent aa9bb12b16
commit cd660ef242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ class AccountSettings extends Model
[['timeZone'], 'in', 'range' => \DateTimeZone::listIdentifiers()],
['language', 'in', 'range' => array_keys(Yii::$app->i18n->getAllowedLanguages())],
['visibility', 'in', 'range' => array_keys($this->getVisibilityOptions()),
'when' => function (self $model) {return $model->isVisibilityEditable();}],
'when' => function (self $model) {return $model->isVisibilityViewable() && $model->isVisibilityEditable();}],
];
}