rafaelweingartner commented on a change in pull request #3058: CLOUDSTACK-3049: 
update dynamic role for an account
URL: https://github.com/apache/cloudstack/pull/3058#discussion_r236619297
 
 

 ##########
 File path: server/src/main/java/com/cloud/user/AccountManagerImpl.java
 ##########
 @@ -1714,23 +1720,37 @@ public AccountVO updateAccount(UpdateAccountCmd cmd) {
         // Check if user performing the action is allowed to modify this 
account
         checkAccess(getCurrentCallingAccount(), 
_domainMgr.getDomain(account.getDomainId()));
 
-        // check if the given account name is unique in this domain for 
updating
-        Account duplicateAcccount = 
_accountDao.findActiveAccount(newAccountName, domainId);
-        if (duplicateAcccount != null && duplicateAcccount.getId() != 
account.getId()) {
-            throw new InvalidParameterValueException(
-                    "There already exists an account with the name:" + 
newAccountName + " in the domain:" + domainId + " with existing account id:" + 
duplicateAcccount.getId());
+        if(newAccountName != null) {
 
 Review comment:
   You can use `StringUtils.isEmpty` here. Then, you do not need all of these 
netsting

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to