diff --git a/src/Squidex.Domain.Apps.Entities/Apps/Guards/GuardAppContributors.cs b/src/Squidex.Domain.Apps.Entities/Apps/Guards/GuardAppContributors.cs index 21b1b0a51..74f0bb850 100644 --- a/src/Squidex.Domain.Apps.Entities/Apps/Guards/GuardAppContributors.cs +++ b/src/Squidex.Domain.Apps.Entities/Apps/Guards/GuardAppContributors.cs @@ -56,7 +56,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Guards e(Not.New("Contributor", "role"), nameof(command.Role)); } } - else if (plan.MaxContributors == contributors.Count) + else if (contributors.Count >= plan.MaxContributors && !command.IsRestore) { e("You have reached the maximum number of contributors for your plan."); } diff --git a/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs b/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs index d2cf81238..a29985b7b 100644 --- a/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs +++ b/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs @@ -246,16 +246,23 @@ namespace Squidex.Domain.Apps.Entities.Backup if (actor?.IsSubject == true) { - await commandBus.PublishAsync(new AssignContributor + try { - Actor = actor, - AppId = CurrentJob.AppId, - ContributorId = actor.Identifier, - IsRestore = true, - Role = Role.Owner - }); - - Log("Assigned current user."); + await commandBus.PublishAsync(new AssignContributor + { + Actor = actor, + AppId = CurrentJob.AppId, + ContributorId = actor.Identifier, + IsRestore = true, + Role = Role.Owner + }); + + Log("Assigned current user."); + } + catch (DomainException ex) + { + Log($"Failed to assign contributor: {ex.Message}"); + } } else { diff --git a/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs b/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs index 737c0c395..d71fb128d 100644 --- a/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs +++ b/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs @@ -52,16 +52,19 @@ namespace Squidex.Areas.Frontend.Middlewares await next(context); - context.Response.Body = responseBody; + if (context.Response.StatusCode != 304) + { + context.Response.Body = responseBody; - var html = Encoding.UTF8.GetString(responseBuffer.ToArray()); + var html = Encoding.UTF8.GetString(responseBuffer.ToArray()); - html = AdjustBase(html, context.Request.PathBase); + html = AdjustBase(html, context.Request.PathBase); - context.Response.ContentLength = Encoding.UTF8.GetByteCount(html); - context.Response.Body = responseBody; + context.Response.ContentLength = Encoding.UTF8.GetByteCount(html); + context.Response.Body = responseBody; - await context.Response.WriteAsync(html); + await context.Response.WriteAsync(html); + } } else { diff --git a/src/Squidex/appsettings.json b/src/Squidex/appsettings.json index fa83eb5db..70a795373 100644 --- a/src/Squidex/appsettings.json +++ b/src/Squidex/appsettings.json @@ -104,7 +104,7 @@ /* * The email body when a new user is added as contributor. */ - "newUserBody": "Welcome to Squidex\r\nDear User,\r\n\r\n{{$ASSIGNER_NAME}} ($ASSIGNER_EMAIL) has invited you to join Project (also called an App) {{var:app_name}} at Squidex Headless CMS. Login with your Github, Google or Microsoft credentials to create a new user account and start editing content now.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n<> [$UI_URL]", + "newUserBody": "Welcome to Squidex\r\nDear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join Project (also called an App) $APP_NAME at Squidex Headless CMS. Login with your Github, Google or Microsoft credentials to create a new user account and start editing content now.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n<> [$UI_URL]", /* * The email subject when an existing user is added as contributor. */ @@ -112,7 +112,7 @@ /* * The email body when an existing user is added as contributor. */ - "existingUserBody": "Dear User,\r\n\r\n{{$ASSIGNER_NAME}} ($ASSIGNER_EMAIL) has invited you to join App {{var:app_name}} at Squidex Headless CMS.\r\n\r\nLogin or reload the Management UI to see the App.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n<> [$UI_URL]" + "existingUserBody": "Dear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join App $APP_NAME at Squidex Headless CMS.\r\n\r\nLogin or reload the Management UI to see the App.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n<> [$UI_URL]" } },