Damans227 commented on code in PR #14150:
URL: https://github.com/apache/cloudstack/pull/14150#discussion_r4272773161
##########
server/src/main/java/com/cloud/projects/ProjectManagerImpl.java:
##########
@@ -449,7 +449,7 @@ public Boolean doInTransaction(TransactionStatus status) {
@Override
public boolean unassignAccountFromProject(long projectId, long accountId) {
- ProjectAccountVO projectAccount =
_projectAccountDao.findByProjectIdAccountId(projectId, accountId);
+ ProjectAccountVO projectAccount =
_projectAccountDao.findByProjectIdUserId(projectId, accountId, null);
Review Comment:
what about projects deleted before this fix? their leftover user rows still
block deleting the account, should the upgrade clean those up too?
##########
engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java:
##########
@@ -108,10 +108,12 @@ public ProjectAccountVO findByProjectIdAccountId(long
projectId, long accountId)
}
@Override
- public ProjectAccountVO findByProjectIdUserId(long projectId, long
accountId, long userId) {
+ public ProjectAccountVO findByProjectIdUserId(long projectId, long
accountId, Long userId) {
SearchCriteria<ProjectAccountVO> sc = AllFieldsSearch.create();
sc.setParameters("projectId", projectId);
- sc.setParameters("userId", userId);
+ if (userId != null) {
Review Comment:
can we keep this lookup as is and remove each row by its id in the cleanup
loop instead? the loop already has the row
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]