summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-12-09 18:43:03 -0500
committerCorey Hulen <corey@hulen.com>2016-12-09 15:43:03 -0800
commitaaa41535f8ac9656d0cd399aeedf58de9b374b65 (patch)
tree34d15671bf4b6f50fdb96a0fe1f1967885d87931 /store/sql_channel_store.go
parent9670afed82e6c3192d230f107b836e21bb0c01a6 (diff)
downloadchat-aaa41535f8ac9656d0cd399aeedf58de9b374b65.tar.gz
chat-aaa41535f8ac9656d0cd399aeedf58de9b374b65.tar.bz2
chat-aaa41535f8ac9656d0cd399aeedf58de9b374b65.zip
PLT-3736 Fixed duplicated create_direct api calls not returning the existing channel (#4745)
* Fixed duplicated create_direct api calls not returning the existing channel * Added unit tests for duplicated create_direct api calls
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r--store/sql_channel_store.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index 3ce672a68..aed568b46 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -210,7 +210,7 @@ func (s SqlChannelStore) saveChannelT(transaction *gorp.Transaction, channel *mo
if err := transaction.Insert(channel); err != nil {
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})
+ s.GetMaster().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId = :TeamId AND Name = :Name", map[string]interface{}{"TeamId": channel.TeamId, "Name": channel.Name})
if dupChannel.DeleteAt > 0 {
result.Err = model.NewLocAppError("SqlChannelStore.Save", "store.sql_channel.save_channel.previously.app_error", nil, "id="+channel.Id+", "+err.Error())
} else {