Commit 51b41633 authored by Rémy Coutable's avatar Rémy Coutable

Backport a change made in EE

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b6236823
...@@ -59,7 +59,9 @@ module API ...@@ -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]) 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 present member.user, with: Entities::Member, member: member
else else
render_validation_error!(member) 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