diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 17:29:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 17:29:59 +0300 |
commit | e80b54a5d37aa0fad54e90a7bcc2af0de2f18be6 (patch) | |
tree | 3606a874f8570dfa705e2d330f4e68c0cb9f5cdb /app | |
parent | 65e85dd1d83c9f4fe550ab66a7ff113c35708c5d (diff) |
Add latest changes from gitlab-org/security/gitlab@12-10-stable-ee
Diffstat (limited to 'app')
-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 |