DaanHoogland commented on code in PR #9572:
URL: https://github.com/apache/cloudstack/pull/9572#discussion_r1727120762
##########
server/src/main/java/com/cloud/event/ActionEventUtils.java:
##########
@@ -123,7 +125,7 @@ public static void startNestedActionEvent(String eventType,
String eventDescript
public static void onStartedActionEventFromContext(String eventType,
String eventDescription, Long resourceId, String resourceType, boolean
eventDisplayEnabled) {
CallContext ctx = CallContext.current();
long userId = ctx.getCallingUserId();
- long accountId = ctx.getProject() != null ?
ctx.getProject().getProjectAccountId() : ctx.getCallingAccountId(); //This
should be the entity owner id rather than the Calling User Account Id.
+ long accountId = ctx.getProject() != null &&
!EventTypes.EVENT_PROJECT_CREATE.equalsIgnoreCase(eventType) ?
ctx.getProject().getProjectAccountId() : ctx.getCallingAccountId(); //This
should be the entity owner id rather than the Calling User Account Id.
Review Comment:
quite a recurring pattern, maybe a getAccount()?
--
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]