Skip to content

The Unified and Autonomous Development Platform

fix issue #195 - Non-existent user "OneDev" appears in reviewer choice when define branch protection rules

Robin Shenb621da9b5e50
diff --git a/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.java b/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.java
index fa1086455d..93c205820d 100644
--- a/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.java
+++ b/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.java
@@ -181,6 +181,7 @@ public class SuggestionUtils {
Restrictions.ilike(User.PROP_NAME, "%" + matchWith + "%"),
Restrictions.ilike(User.PROP_EMAIL, "%" + matchWith + "%"),
Restrictions.ilike(User.PROP_FULL_NAME, "%" + matchWith + "%")));
+ criteria.add(Restrictions.not(Restrictions.eq("id", User.SYSTEM_ID)));
for (User user: OneDev.getInstance(UserManager.class).query(criteria)) {
LinearRange match = LinearRange.match(user.getName(), matchWith);