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
+9 -6
View File
@@ -80,13 +80,16 @@ namespace Disco.Web.Controllers
} }
if (string.IsNullOrWhiteSpace(m.Device.DeviceDomainId)) if (string.IsNullOrWhiteSpace(m.Device.DeviceDomainId))
m.Device.DeviceDomainId = null; m.Device.DeviceDomainId = null;
try if (m.Device.DeviceDomainId != null)
{ {
m.Device.DeviceDomainId = ActiveDirectory.ParseDomainAccountId(m.Device.DeviceDomainId); try
} {
catch (ArgumentException ex) m.Device.DeviceDomainId = ActiveDirectory.ParseDomainAccountId(m.Device.DeviceDomainId);
{ }
ModelState.AddModelError("Device.DeviceDomainId", ex.Message); catch (ArgumentException ex)
{
ModelState.AddModelError("Device.DeviceDomainId", ex.Message);
}
} }
if (ModelState.IsValid) if (ModelState.IsValid)