fix: don't try to import config if it's not present in export file
This commit is contained in:
parent
3dbfe3c1a5
commit
40955ffc69
@ -30,23 +30,23 @@ public partial class BulkImporter
|
||||
|
||||
await _repo.UpdateSystem(_system.Id, patch, _conn);
|
||||
|
||||
var configPatch = new SystemConfigPatch();
|
||||
|
||||
if (importFile.ContainsKey("config"))
|
||||
configPatch = SystemConfigPatch.FromJson(importFile.Value<JObject>("config"));
|
||||
{
|
||||
var configPatch = SystemConfigPatch.FromJson(importFile.Value<JObject>("config"));
|
||||
|
||||
if (importFile.ContainsKey("timezone"))
|
||||
configPatch.UiTz = importFile.Value<string>("timezone");
|
||||
if (importFile.ContainsKey("timezone"))
|
||||
configPatch.UiTz = importFile.Value<string>("timezone");
|
||||
|
||||
configPatch.AssertIsValid();
|
||||
if (configPatch.Errors.Count > 0)
|
||||
throw new ImportException($"Field config.{patch.Errors[0].Key} in export file is invalid.");
|
||||
configPatch.AssertIsValid();
|
||||
if (configPatch.Errors.Count > 0)
|
||||
throw new ImportException($"Field config.{patch.Errors[0].Key} in export file is invalid.");
|
||||
|
||||
await _repo.UpdateSystemConfig(_system.Id, configPatch, _conn);
|
||||
await _repo.UpdateSystemConfig(_system.Id, configPatch, _conn);
|
||||
}
|
||||
|
||||
var members = importFile.Value<JArray>("members");
|
||||
var groups = importFile.Value<JArray>("groups");
|
||||
var switches = importFile.Value<JArray>("switches");
|
||||
var groups = importFile.Value<JArray>("groups");
|
||||
|
||||
var newMembers = members.Count(m =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user