Fix Device Batch Managed Groups
This commit is contained in:
@@ -57,7 +57,7 @@ namespace Disco.Services.Devices.ManagedGroups
|
|||||||
repositorySubscription = RepositoryEvents.Value
|
repositorySubscription = RepositoryEvents.Value
|
||||||
.Where(e =>
|
.Where(e =>
|
||||||
(((Device)e.Entity).DeviceBatchId == DeviceBatchId) ||
|
(((Device)e.Entity).DeviceBatchId == DeviceBatchId) ||
|
||||||
(e.EventType == RepositoryMonitorEventType.Modified && e.GetPreviousPropertyValue<int>("DeviceBatchId") == DeviceBatchId))
|
(e.EventType == RepositoryMonitorEventType.Modified && e.GetPreviousPropertyValue<int?>("DeviceBatchId") == DeviceBatchId))
|
||||||
.Subscribe(ProcessRepositoryEvent);
|
.Subscribe(ProcessRepositoryEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace Disco.Services.Devices.ManagedGroups
|
|||||||
repositorySubscription = RepositoryEvents.Value
|
repositorySubscription = RepositoryEvents.Value
|
||||||
.Where(e =>
|
.Where(e =>
|
||||||
(((Device)e.Entity).DeviceBatchId == DeviceBatchId) ||
|
(((Device)e.Entity).DeviceBatchId == DeviceBatchId) ||
|
||||||
(e.EventType == RepositoryMonitorEventType.Modified && e.GetPreviousPropertyValue<int>("DeviceBatchId") == DeviceBatchId))
|
(e.EventType == RepositoryMonitorEventType.Modified && e.GetPreviousPropertyValue<int?>("DeviceBatchId") == DeviceBatchId))
|
||||||
.Subscribe(ProcessRepositoryEvent);
|
.Subscribe(ProcessRepositoryEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
DeviceBatch.AssignedUsersLinkedGroup = configJson;
|
DeviceBatch.AssignedUsersLinkedGroup = configJson;
|
||||||
Database.SaveChanges();
|
Database.SaveChanges();
|
||||||
|
|
||||||
var managedGroup = DeviceBatchDevicesManagedGroup.Initialize(DeviceBatch);
|
var managedGroup = DeviceBatchAssignedUsersManagedGroup.Initialize(DeviceBatch);
|
||||||
if (managedGroup != null) // Sync Group
|
if (managedGroup != null) // Sync Group
|
||||||
return ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
|
return ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user