mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
fixed one of URL prefix and Host should be required
This commit is contained in:
@@ -68,6 +68,10 @@ namespace Orchard.MultiTenancy.Controllers {
|
||||
ModelState.AddModelError("Name", T("Invalid tenant name. Must contain characters only and no spaces.").Text);
|
||||
}
|
||||
|
||||
if (!string.Equals(viewModel.Name, "default", StringComparison.OrdinalIgnoreCase) && string.IsNullOrWhiteSpace( viewModel.RequestUrlHost) && string.IsNullOrWhiteSpace(viewModel.RequestUrlPrefix)) {
|
||||
ModelState.AddModelError("RequestUrlHostRequestUrlPrefix", T("RequestUrlHost and RequestUrlPrefix can not be empty at the same time.").Text);
|
||||
}
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
return View(viewModel);
|
||||
}
|
||||
@@ -139,6 +143,10 @@ namespace Orchard.MultiTenancy.Controllers {
|
||||
if (tenant == null)
|
||||
return HttpNotFound();
|
||||
|
||||
if (!string.Equals(viewModel.Name, "default", StringComparison.OrdinalIgnoreCase) && string.IsNullOrWhiteSpace(viewModel.RequestUrlHost) && string.IsNullOrWhiteSpace(viewModel.RequestUrlPrefix)) {
|
||||
ModelState.AddModelError("RequestUrlHostRequestUrlPrefix", T("RequestUrlHost and RequestUrlPrefix can not be empty at the same time.").Text);
|
||||
}
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user