lahirujayathilake commented on code in PR #638:
URL: https://github.com/apache/airavata-custos/pull/638#discussion_r4307154799


##########
connectors/ACCESS/AMIE-Processor/handler/request_account_create.go:
##########
@@ -118,8 +118,10 @@ func (h *RequestAccountCreateHandler) Handle(ctx 
context.Context, tx *sql.Tx, pa
        if err != nil {
                return fmt.Errorf("request_account_create: ensure membership: 
%w", err)
        }
-       if err := h.svc.EnsureProjectMembership(ctx, project.ID, user.ID, 
role); err != nil {
-               return fmt.Errorf("request_account_create: ensure project 
membership: %w", err)
+       if user.ID != project.ProjectPIID {
+               if err := h.svc.EnsureProjectMembership(ctx, project.ID, 
user.ID, role); err != nil {
+                       return fmt.Errorf("request_account_create: ensure 
project membership: %w", err)
+               }

Review Comment:
   Good catch!
   One more thing if the user is PI then we should send a failure reply instead 
sending the successful one.



-- 
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]

Reply via email to