summaryrefslogtreecommitdiffstats
path: root/app/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/user.go')
-rw-r--r--app/user.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/user.go b/app/user.go
index 99e9d46a3..e339dfd5b 100644
--- a/app/user.go
+++ b/app/user.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package app
@@ -186,7 +186,9 @@ func CreateUser(user *model.User) (*model.User, *model.AppError) {
}
}
- user.Locale = *utils.Cfg.LocalizationSettings.DefaultClientLocale
+ if _, ok := utils.GetSupportedLocales()[user.Locale]; !ok {
+ user.Locale = *utils.Cfg.LocalizationSettings.DefaultClientLocale
+ }
if ruser, err := createUser(user); err != nil {
return nil, err