diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-03-01 22:34:29 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-03-02 12:21:29 +0300 |
commit | 52c4a7866ed010d8db67e5ca976d8c73d4084784 (patch) | |
tree | a1cbb2d3910f9433e23dec22cc0f8c94c2e8675c /app/services/groups/create_service.rb | |
parent | f6247600a3f5d500952b0ba32e6915a2d045e392 (diff) |
Improve UX
Diffstat (limited to 'app/services/groups/create_service.rb')
-rw-r--r-- | app/services/groups/create_service.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/services/groups/create_service.rb b/app/services/groups/create_service.rb index 4ed2cb7c8af..6ef78c3e677 100644 --- a/app/services/groups/create_service.rb +++ b/app/services/groups/create_service.rb @@ -23,7 +23,11 @@ module Groups @group.name ||= @group.path.dup if create_chat_team? - Mattermost::CreateTeamService.new(@group, current_user).execute + begin + response = Mattermost::CreateTeamService.new(@group, current_user).execute + + @group.build_chat_team(name: response['name'], team_id: response['id']) + end return @group if @group.errors.any? end @@ -32,5 +36,11 @@ module Groups @group.add_owner(current_user) @group end + + private + + def create_chat_team? + Gitlab.config.mattermost.enabled && @chat_team && group.chat_team.nil? + end end end |