Bug Fix #4: Only reference jobs where device held

This commit is contained in:
Gary Sharp
2014-02-18 17:00:14 +11:00
parent bfa3bf1e94
commit a82e039140
4 changed files with 8 additions and 8 deletions
@@ -2158,13 +2158,13 @@ namespace Disco.Web.Areas.API.Controllers
throw new InvalidOperationException("Unknown Location Mode Configured");
}
var locationReferences = ManagedJobList.OpenJobsTable(j => j).Items.JobLocationReferences(locations);
var locationReferences = ManagedJobList.OpenJobsTable(j => j).Items.Cast<JobTableStatusItemModel>().JobLocationReferences(locations);
var results = locationReferences.Select(locRef =>
{
string reference = null;
if (locRef.References == null && locRef.References.Count > 0)
if (locRef.References != null && locRef.References.Count > 0)
{
if (locRef.References.Count == 1)
reference = string.Format("Job {0}", locRef.References[0].JobId);
+1 -1
View File
@@ -354,7 +354,7 @@ namespace Disco.Web.Controllers
{
m.LocationMode = Database.DiscoConfiguration.JobPreferences.LocationMode;
if (m.LocationMode == LocationModes.RestrictedList)
m.LocationOptions = ManagedJobList.OpenJobsTable(j => j).Items.JobLocationReferences(Database.DiscoConfiguration.JobPreferences.LocationList).ToList();
m.LocationOptions = ManagedJobList.OpenJobsTable(j => j).Items.Cast<JobTableStatusItemModel>().JobLocationReferences(Database.DiscoConfiguration.JobPreferences.LocationList).ToList();
}
// UI Extensions