Commit e84b60f4 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ce-4135-remove-ee-specific-code-from-post-api-v4-projects-id-members' into 'master'

Backport part of EE's "Remove EE-specific code from `POST /api/v4/projects/:id/members`"

See merge request gitlab-org/gitlab-ce!16051
parents 5f5ac346 51b41633
......@@ -59,7 +59,9 @@ module API
member = source.add_user(params[:user_id], params[:access_level], current_user: current_user, expires_at: params[:expires_at])
if member.persisted? && member.valid?
if !member
not_allowed! # This currently can only be reached in EE
elsif member.persisted? && member.valid?
present member.user, with: Entities::Member, member: member
else
render_validation_error!(member)
......
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