bug: when adding computer offline, computer name should not be required

This commit is contained in:
Gary Sharp
2023-02-09 20:03:20 +11:00
parent af75a55d44
commit 190abc72dd
@@ -80,6 +80,8 @@ namespace Disco.Web.Controllers
} }
if (string.IsNullOrWhiteSpace(m.Device.DeviceDomainId)) if (string.IsNullOrWhiteSpace(m.Device.DeviceDomainId))
m.Device.DeviceDomainId = null; m.Device.DeviceDomainId = null;
if (m.Device.DeviceDomainId != null)
{
try try
{ {
m.Device.DeviceDomainId = ActiveDirectory.ParseDomainAccountId(m.Device.DeviceDomainId); m.Device.DeviceDomainId = ActiveDirectory.ParseDomainAccountId(m.Device.DeviceDomainId);
@@ -88,6 +90,7 @@ namespace Disco.Web.Controllers
{ {
ModelState.AddModelError("Device.DeviceDomainId", ex.Message); ModelState.AddModelError("Device.DeviceDomainId", ex.Message);
} }
}
if (ModelState.IsValid) if (ModelState.IsValid)
{ {