Quota: fix

This commit is contained in:
Nikolay Rechkin 2022-10-06 15:17:07 +03:00
parent 679a414f16
commit f655620485
2 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ public class EmployeeFullDtoHelper : EmployeeDtoHelper
await Init(result, userInfo);
result.UsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(_context.Tenant.Id, userInfo.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
result.UsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(_context.Tenant.Id, userInfo.IsLDAP() ? Guid.Parse(userInfo.Sid) : userInfo.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
var quotaSettings = _settingsManager.Load<TenantUserQuotaSettings>();
var userQuotaSettings = _settingsManager.LoadForUser<UserQuotaSettings>(userInfo);

View File

@ -426,7 +426,7 @@ internal class FileDao : AbstractDao, IFileDao<int>
if (quotaLimit != -1)
{
var userUsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(TenantID, user.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
var userUsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(TenantID,user.IsLDAP() ? Guid.Parse(user.Sid) : user.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter));
if (quotaLimit - userUsedSpace < file.ContentLength)
{