Commit 7fc54bf1 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Move load_recaptcha method

parent 3874239b
......@@ -24,7 +24,7 @@ class GroupsController < Groups::ApplicationController
# Authorize
before_action :authorize_admin_group!, only: [:edit, :update, :destroy, :projects, :transfer, :export, :download_export]
before_action :authorize_create_group!, only: [:new]
before_action :load_recaptcha, only: [:new, :create], if: -> { captcha_required? }
before_action :load_recaptcha, only: [:new], if: -> { captcha_required? }
before_action :group_projects, only: [:projects, :activity, :issues, :merge_requests]
before_action :event_filter, only: [:activity]
......@@ -331,6 +331,8 @@ class GroupsController < Groups::ApplicationController
def check_captcha
return if group_params[:parent_id].present? # Only require for top-level groups
load_recaptcha
return if verify_recaptcha
flash[:alert] = _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment