mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:36:51 +08:00
Changed the default value for SetupViewModel to be the built-in database option and added a check to ensure a connection string was entered when the sql database option is checked
--HG-- branch : dev
This commit is contained in:
@@ -46,11 +46,15 @@ namespace Orchard.Setup.Controllers {
|
||||
|
||||
[HttpPost, ActionName("Index")]
|
||||
public ActionResult IndexPOST(SetupViewModel model) {
|
||||
try {
|
||||
if (!ModelState.IsValid) {
|
||||
return Index(model);
|
||||
}
|
||||
//HACK: (erikpo) Couldn't get a custom ValidationAttribute to validate two properties
|
||||
if (!model.DatabaseOptions && string.IsNullOrEmpty(model.DatabaseConnectionString))
|
||||
ModelState.AddModelError("DatabaseConnectionString", "A SQL connection string is required");
|
||||
|
||||
if (!ModelState.IsValid) {
|
||||
return Index(model);
|
||||
}
|
||||
|
||||
try {
|
||||
var shellSettings = new ShellSettings {
|
||||
Name = "default",
|
||||
DataProvider = model.DatabaseOptions ? "SQLite" : "SqlServer",
|
||||
|
Reference in New Issue
Block a user