diff --git a/app/controllers/OrganizationApp.java b/app/controllers/OrganizationApp.java index 832706be4..eb9e69940 100644 --- a/app/controllers/OrganizationApp.java +++ b/app/controllers/OrganizationApp.java @@ -240,7 +240,8 @@ private static Result validateForEditMember(Form roleForm, String organiza return okWithLocation(routes.OrganizationApp.members(organizationName).url()); } - if (organization.isLastAdmin(currentUser) && roleForm.get().id.equals(RoleType.ORG_MEMBER.roleType())) { + if (organization.isLastAdmin(User.find.byId(userId)) + && roleForm.get().id.equals(RoleType.ORG_MEMBER.roleType())) { flash(Constants.WARNING, "organization.member.atLeastOneAdmin"); return okWithLocation(routes.OrganizationApp.members(organizationName).url()); }