Merge pull request #8926 from nextcloud/ocs-api-quota-fallback
Return quota even if user is not initialised
This commit is contained in:
commit
3678d3b14a
|
@ -909,7 +909,16 @@ class UsersController extends OCSController {
|
|||
'quota' => $storage['quota'],
|
||||
];
|
||||
} 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 ? $quota : 'none',
|
||||
'used' => 0
|
||||
];
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue