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

[GitHub] [cloudstack] weizhouapache commented on a diff in pull request #7169: server: fix exception while list users with keyword

weizhouapache commented on code in PR #7169:
URL: https://github.com/apache/cloudstack/pull/7169#discussion_r1097442079


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -617,7 +618,9 @@ private Pair<List<UserAccountJoinVO>, Integer> getUserListInternal(Account calle
             ssc.addOr("email", Op.LIKE, "%" + keyword + "%");
             ssc.addOr("state", Op.LIKE, "%" + keyword + "%");
             ssc.addOr("accountName", Op.LIKE, "%" + keyword + "%");
-            ssc.addOr("accountType", Op.LIKE, "%" + keyword + "%");
+            if (EnumUtils.isValidEnum(Account.Type.class, keyword.toString().toUpperCase())) {
+                ssc.addOr("accountType", Op.EQ, EnumUtils.getEnum(Account.Type.class, keyword.toString().toUpperCase()));
+            }

Review Comment:
   @DaanHoogland 
   is valueOf case sensitive ?



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