Backport a change made in EE
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
b62368235b
commit
51b416338a
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue