summaryrefslogtreecommitdiff
path: root/app/controllers/groups_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index d5f2239b16a..fba374dbb44 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -57,6 +57,8 @@ class GroupsController < Groups::ApplicationController
@group = Groups::CreateService.new(current_user, group_params).execute
if @group.persisted?
+ track_experiment_event(:onboarding_issues, 'created_namespace')
+
notice = if @group.chat_team.present?
"Group '#{@group.name}' and its Mattermost team were successfully created."
else
@@ -72,7 +74,11 @@ class GroupsController < Groups::ApplicationController
def show
respond_to do |format|
format.html do
- render_show_html
+ if @group.import_state&.in_progress?
+ redirect_to group_import_path(@group)
+ else
+ render_show_html
+ end
end
format.atom do
@@ -264,11 +270,12 @@ class GroupsController < Groups::ApplicationController
def export_rate_limit
prefixed_action = "group_#{params[:action]}".to_sym
- if Gitlab::ApplicationRateLimiter.throttled?(prefixed_action, scope: [current_user, prefixed_action, @group])
+ scope = params[:action] == :download_export ? @group : nil
+
+ if Gitlab::ApplicationRateLimiter.throttled?(prefixed_action, scope: [current_user, scope].compact)
Gitlab::ApplicationRateLimiter.log_request(request, "#{prefixed_action}_request_limit".to_sym, current_user)
- flash[:alert] = _('This endpoint has been requested too many times. Try again later.')
- redirect_to edit_group_path(@group)
+ render plain: _('This endpoint has been requested too many times. Try again later.'), status: :too_many_requests
end
end