Fix Device Batch Managed Groups

This commit is contained in:
Gary Sharp
2016-11-09 16:27:07 +11:00
parent afa548fb70
commit f74d49b96e
3 changed files with 3 additions and 3 deletions
@@ -57,7 +57,7 @@ namespace Disco.Services.Devices.ManagedGroups
repositorySubscription = RepositoryEvents.Value
.Where(e =>
(((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);
}
@@ -55,7 +55,7 @@ namespace Disco.Services.Devices.ManagedGroups
repositorySubscription = RepositoryEvents.Value
.Where(e =>
(((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);
}
@@ -500,7 +500,7 @@ namespace Disco.Web.Areas.API.Controllers
DeviceBatch.AssignedUsersLinkedGroup = configJson;
Database.SaveChanges();
var managedGroup = DeviceBatchDevicesManagedGroup.Initialize(DeviceBatch);
var managedGroup = DeviceBatchAssignedUsersManagedGroup.Initialize(DeviceBatch);
if (managedGroup != null) // Sync Group
return ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
}