Skip to content

Commit

Permalink
On package install, DataPackageFragmentInsaller will use default cult…
Browse files Browse the repository at this point in the history
…ure, if user culture is not available. Previously the package install would raise an error. Motivation: For setup flows, where user auth is changed via a package, user information cannot be expected to be available within the same request.
  • Loading branch information
mawtex committed May 22, 2019
1 parent 0efd384 commit 3bfefb4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ public override IEnumerable<XElement> Install()
}
else if (dataType.AddToCurrentLocale)
{
Verify.That(UserValidationFacade.IsLoggedIn(), "Cannot add to the current locale as there's no logged in user.");
var currentLocale = DataLocalizationFacade.DefaultLocalizationCulture;
if (UserValidationFacade.IsLoggedIn())
{
currentLocale = UserSettings.ActiveLocaleCultureInfo;
}

var currentLocale = UserSettings.ActiveLocaleCultureInfo;
using (new DataScope(currentLocale))
{
XElement element = AddData(dataType, currentLocale);
Expand Down

0 comments on commit 3bfefb4

Please sign in to comment.