Skip to content

Commit 761fba3

Browse files
committed
Return quota even if user is not initialized
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent d6bfc98 commit 761fba3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,16 @@ protected function fillStorageInfo(string $userId): array {
821821
'quota' => $storage['quota'],
822822
];
823823
} catch (NotFoundException $ex) {
824-
$data = [];
824+
// User fs is not setup yet
825+
$user = $this->userManager->get($userId);
826+
if ($user === null) {
827+
throw new OCSException('User does not exist', 101);
828+
}
829+
$quota = OC_Helper::computerFileSize($user->getQuota());
830+
$data = [
831+
'quota' => $quota,
832+
'used' => 0
833+
];
825834
}
826835
return $data;
827836
}

0 commit comments

Comments
 (0)