Bug Fix #97 - Removed Organisation Address References
Remove Device Profile references to an address when its removed, and anticipate missing addresses where referenced.
This commit is contained in:
@@ -27,8 +27,12 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
if (DiscoApplication.MultiSiteMode)
|
||||
{
|
||||
foreach (var dp in m.DeviceProfiles)
|
||||
{
|
||||
if (dp.Address.HasValue)
|
||||
dp.AddressName = Database.DiscoConfiguration.OrganisationAddresses.GetAddress(dp.Address.Value).Name;
|
||||
{
|
||||
dp.AddressName = Database.DiscoConfiguration.OrganisationAddresses.GetAddress(dp.Address.Value)?.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
|
||||
Reference in New Issue
Block a user