diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 14:29:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 14:29:59 +0000 |
commit | 5bc4a1efecfffbd467d7e2e2f42f3f1bf6e6f030 (patch) | |
tree | 81f5111534cc56919e4aeb453fc65462e596b56d /app/controllers | |
parent | df400447bfd5c650b32cc8d75fa80f8cc7099d94 (diff) | |
download | gitlab-ce-5bc4a1efecfffbd467d7e2e2f42f3f1bf6e6f030.tar.gz |
Add latest changes from gitlab-org/security/gitlab@13-0-stable-ee
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/concerns/membership_actions.rb | 12 |
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 |