diff --git a/PluralKit.Core/Services/DataFileService.cs b/PluralKit.Core/Services/DataFileService.cs index a2422be0..87f3684c 100644 --- a/PluralKit.Core/Services/DataFileService.cs +++ b/PluralKit.Core/Services/DataFileService.cs @@ -119,7 +119,9 @@ namespace PluralKit.Core system = result.System = await _repo.CreateSystem(conn, data.Name); await _repo.AddAccount(conn, system.Id, accountId); } - + + var memberLimit = system.MemberLimitOverride ?? Limits.MaxMemberCount; + // Apply system info var patch = new SystemPatch {Name = data.Name}; if (data.Description != null) patch.Description = data.Description; @@ -135,10 +137,10 @@ namespace PluralKit.Core // If creating the unmatched members would put us over the member limit, abort before creating any members var memberCountBefore = await _repo.GetSystemMemberCount(conn, system.Id); var membersToAdd = data.Members.Count(m => imp.IsNewMember(m.Id, m.Name)); - if (memberCountBefore + membersToAdd > Limits.MaxMemberCount) + if (memberCountBefore + membersToAdd > memberLimit) { result.Success = false; - result.Message = $"Import would exceed the maximum number of members ({Limits.MaxMemberCount})."; + result.Message = $"Import would exceed the maximum number of members ({memberLimit})."; return result; }