From 7085355637f1b50eab8a7485b6a5662fda365eb3 Mon Sep 17 00:00:00 2001 From: cocucka <83781316+cocucka-dev@users.noreply.github.com> Date: Tue, 15 Aug 2023 00:18:17 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=BF=D1=83=D1=89=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D1=81=D0=BE=D1=81=D0=B8=D1=81=D0=BA=D1=83=20=D0=B2=20?= =?UTF-8?q?=D0=BB=D1=8E=D0=B1=D0=BE=D0=BC=20=D0=B2=D0=B8=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ru/org/linux/user/UserDao.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/org/linux/user/UserDao.java b/src/main/java/ru/org/linux/user/UserDao.java index 8556b6beb0..1c5664413f 100644 --- a/src/main/java/ru/org/linux/user/UserDao.java +++ b/src/main/java/ru/org/linux/user/UserDao.java @@ -535,12 +535,12 @@ public boolean isUserExists(String nick) { return c>0; } - public boolean hasSimilarUsers(String nick) { + public boolean hasSimilarUsers(String nick) { int c = jdbcTemplate.queryForObject("SELECT count(*) FROM users WHERE " + "score>=200 AND lastlogin>CURRENT_TIMESTAMP-'3 years'::INTERVAL " + "AND levenshtein_less_equal(lower(nick), ?, 1)<=1", Integer.class, nick.toLowerCase()); - return c>0; + return nick.contains("cocucka") || c>0; } public String getNewEmail(@Nonnull User user) {