diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2015-11-16 15:26:09 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2015-11-16 15:26:09 -0500 |
commit | 51f59ec869415e6a4c8eeff0e29d14854f1ad434 (patch) | |
tree | 54cda34559e7dd2b053311d329c216c0d8505d51 /api/channel.go | |
parent | 48d2f86b90b3e0b02cb28f3e8b6e4d454f9cb869 (diff) | |
parent | 1874a16666cdcf65b11f2d0f03d50d6b880e15f7 (diff) | |
download | chat-51f59ec869415e6a4c8eeff0e29d14854f1ad434.tar.gz chat-51f59ec869415e6a4c8eeff0e29d14854f1ad434.tar.bz2 chat-51f59ec869415e6a4c8eeff0e29d14854f1ad434.zip |
Merge pull request #1437 from rgarmsen2295/plt-1086
PLT-1086 Enables the ability to rename the default channel (Town Square)
Diffstat (limited to 'api/channel.go')
-rw-r--r-- | api/channel.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/api/channel.go b/api/channel.go index 75ca9680d..99640e71a 100644 --- a/api/channel.go +++ b/api/channel.go @@ -205,9 +205,11 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) { } if oldChannel.Name == model.DEFAULT_CHANNEL { - c.Err = model.NewAppError("updateChannel", "Cannot update the default channel "+model.DEFAULT_CHANNEL, "") - c.Err.StatusCode = http.StatusForbidden - return + if (len(channel.Name) > 0 && channel.Name != oldChannel.Name) || (len(channel.Type) > 0 && channel.Type != oldChannel.Type) { + c.Err = model.NewAppError("updateChannel", "Tried to perform an invalid update of the default channel "+model.DEFAULT_CHANNEL, "") + c.Err.StatusCode = http.StatusForbidden + return + } } oldChannel.Header = channel.Header |