This commit is contained in:
Jamie Rees 2018-04-21 22:47:01 +01:00
parent 0ce9fb2df9
commit a0dbd1c442
5 changed files with 20 additions and 15 deletions

View file

@ -123,7 +123,23 @@ namespace Ombi.Store.Context
{
NormalizedName = OmbiRoles.RecievesNewsletter.ToUpper()
});
SaveChanges();
}
// Make sure we have the API User
var apiUserExists = Users.Any(x => x.UserName.Equals("Api", StringComparison.CurrentCultureIgnoreCase));
if (!apiUserExists)
{
Users.Add(new OmbiUser
{
UserName = "Api",
UserType = UserType.SystemUser,
NormalizedUserName = "API",
});
SaveChanges();
}
//Check if templates exist
var templates = NotificationTemplates.ToList();