diff options
author | George Thomas <iamgeorgethomas@gmail.com> | 2019-02-27 13:11:14 +0530 |
---|---|---|
committer | George Thomas <george.thomas@quintype.com> | 2019-07-18 10:04:06 +0530 |
commit | a9707e8cf70487a52efbe43ffe72c9e995f5cdea (patch) | |
tree | 9c923ed7fc686d94820a47798d0e0c2d3af3a120 /app/controllers/registrations_controller.rb | |
parent | 037096ef6c2c2f804302efb429bcd1eb5123b5e9 (diff) | |
download | gitlab-ce-a9707e8cf70487a52efbe43ffe72c9e995f5cdea.tar.gz |
Rewrite `if:` argument in before_action and alike when `only:` is also used
Closes #55564
This is first discovered in #54739 (comment 122609857) that if both if: and only:
are used in a before_action or after_action or alike, if: is completely ignored.
Diffstat (limited to 'app/controllers/registrations_controller.rb')
-rw-r--r-- | app/controllers/registrations_controller.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index b2b151bbcf0..638934694e0 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -8,8 +8,7 @@ class RegistrationsController < Devise::RegistrationsController prepend_before_action :check_captcha, only: :create before_action :whitelist_query_limiting, only: [:destroy] before_action :ensure_terms_accepted, - if: -> { Gitlab::CurrentSettings.current_application_settings.enforce_terms? }, - only: [:create] + if: -> { action_name == 'create' && Gitlab::CurrentSettings.current_application_settings.enforce_terms? } def new redirect_to(new_user_session_path) |