DbUserBackend: don't fail at validation if there aren't any active users
refs #2598
This commit is contained in:
parent
b0221c5e13
commit
f323310174
|
@ -285,12 +285,7 @@ class DbUserBackend extends DbRepository implements UserBackendInterface, Inspec
|
||||||
$insp = new Inspection('Db User Backend');
|
$insp = new Inspection('Db User Backend');
|
||||||
$insp->write($this->ds->inspect());
|
$insp->write($this->ds->inspect());
|
||||||
try {
|
try {
|
||||||
$users = $this->select()->where('is_active', true)->count();
|
$insp->write(sprintf('%s active users', $this->select()->where('is_active', true)->count()));
|
||||||
if ($users > 0) {
|
|
||||||
$insp->write(sprintf('%s active users', $users));
|
|
||||||
} else {
|
|
||||||
return $insp->error('0 active users', $users);
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$insp->error(sprintf('Query failed: %s', $e->getMessage()));
|
$insp->error(sprintf('Query failed: %s', $e->getMessage()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue