hunk.code_window: 	}
   	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", map[string]interface{}{"TeamId": channel.TeamId, "Name": channel.Name})
   			if dupChannel.DeleteAt > 0 {
   				result.Err = model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save_channel.previously.app_error", nil, "id="+channel.Id+", "+err.Error(), http.StatusBadRequest)
   			} else {
  
hunk.labels: keep keep keep replace keep keep keep keep keep
hunk.after_edit: 		if IsUniqueConstraintError(err, []string{"Name", "channels_name_teamid_key"}) {
  
hunk.file_path: store/sql_channel_store.go
hunk.type: replace
file: // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
  // See License.txt for license information.
  
  import React from 'react';
  import {shallow} from 'enzyme';
  
  import ColorSetting from 'components/admin_console/color_setting.jsx';
  
  describe('components/ColorSetting', () => {
      test('should match snapshot, all', () => {
          function emptyFunction() {} //eslint-disable-line no-empty-function
  
          const wrapper = shallow(
              <ColorSetting
                  id='id'
                  label='label'
                  helpText='helptext'
                  value='#fff'
                  onChange={emptyFunction}
                  disabled={false}
              />
          );
          expect(wrapper).toMatchSnapshot();
      });
  
      test('should match snapshot, no help text', () => {
          function emptyFunction() {} //eslint-disable-line no-empty-function
  
          const wrapper = shallow(
              <ColorSetting
                  id='id'
                  label='label'
                  value='#fff'
                  onChange={emptyFunction}
                  disabled={false}
              />
          );
          expect(wrapper).toMatchSnapshot();
      });
  
      test('should match snapshot, disabled', () => {
          function emptyFunction() {} //eslint-disable-line no-empty-function
  
          const wrapper = shallow(
              <ColorSetting
                  id='id'
                  label='label'
                  value='#fff'
                  onChange={emptyFunction}
                  disabled={true}
              />
          );
          expect(wrapper).toMatchSnapshot();
      });
  });
  