summaryrefslogtreecommitdiff
path: root/lib/mattermost
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-02-20 13:41:50 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-02-20 13:41:50 +0100
commit444d71e043eb19979ec1b08504b2760910cb2a47 (patch)
treeeae73ba8a12de1a84faee800fae9749b70ed1b78 /lib/mattermost
parent549fc3469790da388035de713294f335fbfb4fb5 (diff)
downloadgitlab-ce-444d71e043eb19979ec1b08504b2760910cb2a47.tar.gz
Transactional mattermost team creation
Before this commit, but still on this feature branch, the creation of mattermost teams where a background job. However, it was decided it was better that these happened as transaction so feedback could be displayed to the user.
Diffstat (limited to 'lib/mattermost')
-rw-r--r--lib/mattermost/team.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/mattermost/team.rb b/lib/mattermost/team.rb
index d5648f7167f..52486fd1a54 100644
--- a/lib/mattermost/team.rb
+++ b/lib/mattermost/team.rb
@@ -7,20 +7,20 @@ module Mattermost
# Creates a team on the linked Mattermost instance, the team admin will be the
# `current_user` passed to the Mattermost::Client instance
- def create(group, params)
- session_post('/api/v3/teams/create', body: new_team_params(group, params).to_json)
+ def create(group)
+ session_post('/api/v3/teams/create', body: new_team_params(group).to_json)
end
private
MATTERMOST_TEAM_LENGTH_MAX = 59
- def new_team_params(group, options)
+ def new_team_params(group)
{
name: group.path[0..MATTERMOST_TEAM_LENGTH_MAX],
display_name: group.name[0..MATTERMOST_TEAM_LENGTH_MAX],
type: group.public? ? 'O' : 'I' # Open vs Invite-only
- }.merge(options)
+ }
end
end
end