From 11ffccf9830c17309c37428b5a66d2f7ca643830 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Thu, 6 Oct 2022 11:22:10 +0300 Subject: [PATCH] fix --- common/ASC.Api.Core/Model/EmployeeFullDto.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/ASC.Api.Core/Model/EmployeeFullDto.cs b/common/ASC.Api.Core/Model/EmployeeFullDto.cs index 4a49b8c3e1..83a1c8995c 100644 --- a/common/ASC.Api.Core/Model/EmployeeFullDto.cs +++ b/common/ASC.Api.Core/Model/EmployeeFullDto.cs @@ -197,13 +197,12 @@ 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)); - var quotaSettings = _settingsManager.Load(); - var userQuotaSettings = _settingsManager.LoadForUser(userInfo); if (quotaSettings.EnableUserQuota) { + result.UsedSpace = Math.Max(0, _userManager.FindUserQuotaRows(_context.Tenant.Id, userInfo.Id).Where(r => !string.IsNullOrEmpty(r.Tag)).Sum(r => r.Counter)); + var userQuotaSettings = _settingsManager.LoadForUser(userInfo); result.QuotaLimit = userQuotaSettings != null ? userQuotaSettings.UserQuota : quotaSettings.DefaultUserQuota; }