summaryrefslogtreecommitdiff
path: root/app/controllers/concerns
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 14:29:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 14:29:59 +0000
commit5bc4a1efecfffbd467d7e2e2f42f3f1bf6e6f030 (patch)
tree81f5111534cc56919e4aeb453fc65462e596b56d /app/controllers/concerns
parentdf400447bfd5c650b32cc8d75fa80f8cc7099d94 (diff)
downloadgitlab-ce-5bc4a1efecfffbd467d7e2e2f42f3f1bf6e6f030.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-0-stable-ee
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/membership_actions.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/concerns/membership_actions.rb b/app/controllers/concerns/membership_actions.rb
index 1cf9046e30f..4ab02005b45 100644
--- a/app/controllers/concerns/membership_actions.rb
+++ b/app/controllers/concerns/membership_actions.rb
@@ -53,10 +53,16 @@ module MembershipActions
end
def request_access
- membershipable.request_access(current_user)
+ access_requester = membershipable.request_access(current_user)
- redirect_to polymorphic_path(membershipable),
- notice: _('Your request for access has been queued for review.')
+ if access_requester.persisted?
+ redirect_to polymorphic_path(membershipable),
+ notice: _('Your request for access has been queued for review.')
+ else
+ redirect_to polymorphic_path(membershipable),
+ alert: _("Your request for access could not be processed: %{error_meesage}") %
+ { error_meesage: access_requester.errors.full_messages.to_sentence }
+ end
end
def approve_access_request