summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-05-17 12:52:10 -0700
committerChristopher Speller <crspeller@gmail.com>2016-05-17 15:52:10 -0400
commit123bfad69c405b0e78e3031d8064fd7621416867 (patch)
treeca24158452a5d151842994d57f9ceb5cc97e19c4 /store/sql_user_store.go
parentd2b556aa77cc8e8f7d7aef340950fb632fba2aa6 (diff)
downloadchat-123bfad69c405b0e78e3031d8064fd7621416867.tar.gz
chat-123bfad69c405b0e78e3031d8064fd7621416867.tar.bz2
chat-123bfad69c405b0e78e3031d8064fd7621416867.zip
Fixing LDAP issue with Postgres (#3033)
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index a6b706380..11a915055 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -77,9 +77,9 @@ func (us SqlUserStore) Save(user *model.User) StoreChannel {
}
if err := us.GetMaster().Insert(user); err != nil {
- if IsUniqueConstraintError(err.Error(), "Email", "users_email_key") {
+ if IsUniqueConstraintError(err.Error(), []string{"Email", "users_email_key", "idx_users_email_unique"}) {
result.Err = model.NewLocAppError("SqlUserStore.Save", "store.sql_user.save.email_exists.app_error", nil, "user_id="+user.Id+", "+err.Error())
- } else if IsUniqueConstraintError(err.Error(), "Username", "users_username_key") {
+ } else if IsUniqueConstraintError(err.Error(), []string{"Username", "users_username_key", "idx_users_username_unique"}) {
result.Err = model.NewLocAppError("SqlUserStore.Save", "store.sql_user.save.username_exists.app_error", nil, "user_id="+user.Id+", "+err.Error())
} else {
result.Err = model.NewLocAppError("SqlUserStore.Save", "store.sql_user.save.app_error", nil, "user_id="+user.Id+", "+err.Error())
@@ -155,9 +155,9 @@ func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) StoreCha
}
if count, err := us.GetMaster().Update(user); err != nil {
- if IsUniqueConstraintError(err.Error(), "Email", "users_email_teamid_key") {
+ if IsUniqueConstraintError(err.Error(), []string{"Email", "users_email_key", "idx_users_email_unique"}) {
result.Err = model.NewLocAppError("SqlUserStore.Update", "store.sql_user.update.email_taken.app_error", nil, "user_id="+user.Id+", "+err.Error())
- } else if IsUniqueConstraintError(err.Error(), "Username", "users_username_teamid_key") {
+ } else if IsUniqueConstraintError(err.Error(), []string{"Username", "users_username_key", "idx_users_username_unique"}) {
result.Err = model.NewLocAppError("SqlUserStore.Update", "store.sql_user.update.username_taken.app_error", nil, "user_id="+user.Id+", "+err.Error())
} else {
result.Err = model.NewLocAppError("SqlUserStore.Update", "store.sql_user.update.updating.app_error", nil, "user_id="+user.Id+", "+err.Error())