You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2023/02/06 09:26:54 UTC

[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7149: Added Name in updateProject API and UI

DaanHoogland commented on code in PR #7149:
URL: https://github.com/apache/cloudstack/pull/7149#discussion_r1097130252


##########
server/src/main/java/com/cloud/projects/ProjectManagerImpl.java:
##########
@@ -727,10 +734,18 @@ public Project updateProject(final long projectId, final String displayText, fin
         Transaction.execute(new TransactionCallbackWithExceptionNoReturn<ResourceAllocationException>() {
             @Override
             public void doInTransactionWithoutResult(TransactionStatus status) throws ResourceAllocationException {
-                if (displayText != null) {
+                if (displayText != null && name != null) {
+                    project.setDisplayText(displayText);
+                    project.setName(name);
+                    _projectDao.update(projectId, project);
+                } else if (name !=null) {
+                    project.setName(name);
+                    _projectDao.update(projectId, project);
+                } else {
                     project.setDisplayText(displayText);
                     _projectDao.update(projectId, project);
                 }
+

Review Comment:
   this code is a repetition of l 659-669, please create a method



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org