Return quota even if user is not initialized
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
29c551c88f
commit
6e7b7749bd
|
@ -873,7 +873,16 @@ class UsersController extends OCSController {
|
||||||
'quota' => $storage['quota'],
|
'quota' => $storage['quota'],
|
||||||
];
|
];
|
||||||
} catch (NotFoundException $ex) {
|
} catch (NotFoundException $ex) {
|
||||||
$data = [];
|
// User fs is not setup yet
|
||||||
|
$user = $this->userManager->get($userId);
|
||||||
|
if ($user === null) {
|
||||||
|
throw new OCSException('User does not exist', 101);
|
||||||
|
}
|
||||||
|
$quota = OC_Helper::computerFileSize($user->getQuota());
|
||||||
|
$data = [
|
||||||
|
'quota' => $quota,
|
||||||
|
'used' => 0
|
||||||
|
];
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue