diff options
author | Corey Hulen <corey@hulen.com> | 2016-05-17 12:52:10 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-17 15:52:10 -0400 |
commit | 123bfad69c405b0e78e3031d8064fd7621416867 (patch) | |
tree | ca24158452a5d151842994d57f9ceb5cc97e19c4 /store/sql_channel_store.go | |
parent | d2b556aa77cc8e8f7d7aef340950fb632fba2aa6 (diff) | |
download | chat-123bfad69c405b0e78e3031d8064fd7621416867.tar.gz chat-123bfad69c405b0e78e3031d8064fd7621416867.tar.bz2 chat-123bfad69c405b0e78e3031d8064fd7621416867.zip |
Fixing LDAP issue with Postgres (#3033)
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r-- | store/sql_channel_store.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 9f9d86454..0a8873b57 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -165,7 +165,7 @@ func (s SqlChannelStore) saveChannelT(transaction *gorp.Transaction, channel *mo } if err := transaction.Insert(channel); err != nil { - if IsUniqueConstraintError(err.Error(), "Name", "channels_name_teamid_key") { + if IsUniqueConstraintError(err.Error(), []string{"Name", "channels_name_teamid_key"}) { dupChannel := model.Channel{} s.GetMaster().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId = :TeamId AND Name = :Name AND DeleteAt > 0", map[string]interface{}{"TeamId": channel.TeamId, "Name": channel.Name}) if dupChannel.DeleteAt > 0 { @@ -200,7 +200,7 @@ func (s SqlChannelStore) Update(channel *model.Channel) StoreChannel { } if count, err := s.GetMaster().Update(channel); err != nil { - if IsUniqueConstraintError(err.Error(), "Name", "channels_name_teamid_key") { + if IsUniqueConstraintError(err.Error(), []string{"Name", "channels_name_teamid_key"}) { dupChannel := model.Channel{} s.GetReplica().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId = :TeamId AND Name= :Name AND DeleteAt > 0", map[string]interface{}{"TeamId": channel.TeamId, "Name": channel.Name}) if dupChannel.DeleteAt > 0 { @@ -508,7 +508,7 @@ func (s SqlChannelStore) saveMemberT(transaction *gorp.Transaction, member *mode } if err := transaction.Insert(member); err != nil { - if IsUniqueConstraintError(err.Error(), "ChannelId", "channelmembers_pkey") { + if IsUniqueConstraintError(err.Error(), []string{"ChannelId", "channelmembers_pkey"}) { result.Err = model.NewLocAppError("SqlChannelStore.SaveMember", "store.sql_channel.save_member.exists.app_error", nil, "channel_id="+member.ChannelId+", user_id="+member.UserId+", "+err.Error()) } else { result.Err = model.NewLocAppError("SqlChannelStore.SaveMember", "store.sql_channel.save_member.save.app_error", nil, "channel_id="+member.ChannelId+", user_id="+member.UserId+", "+err.Error()) |