From eacc06c7fc712e8b2e71c408327a449bc32c34d9 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 13 Nov 2015 16:22:32 -0800 Subject: Allow admins to change the display name for the default channel --- api/channel.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'api/channel.go') 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 -- cgit v1.2.3-1-g7c22