Fixed IncompleteSetupWarning Admin Check

This commit is contained in:
Lucas Bartholemy 2018-08-18 12:50:25 +02:00
parent e2bfd54e22
commit 83eaf7335a

View File

@ -32,7 +32,7 @@ class IncompleteSetupWarning extends Widget
*/
public function run()
{
if (Yii::$app->user->isAdmin()) {
if (!Yii::$app->user->isAdmin()) {
return;
}
@ -43,6 +43,7 @@ class IncompleteSetupWarning extends Widget
return;
}
$problems = $this->getProblems();
if (count($problems) === 0) {
@ -80,6 +81,7 @@ class IncompleteSetupWarning extends Widget
*/
protected function checkQueue()
{
// Only for database queue
if (Yii::$app->queue instanceof Queue) {
/** @var Queue $queue */
@ -94,6 +96,7 @@ class IncompleteSetupWarning extends Widget
->andWhere('[[pushed_at]] <= :time - delay', [':time' => $time])
->one($queue->db);
if (is_array($counter) && $counter['jobCount'] > 0) {
return false;
}