]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/util/Notary.java
upd: precise SQL statements for verification
[gigi.git] / src / club / wpia / gigi / util / Notary.java
index da80752259cbf9c6edf01043ccefaa4c97b04129..36f1fa48c3c603c3c1dd5ed7ab3a30437bf5d2a1 100644 (file)
@@ -45,7 +45,7 @@ public class Notary {
     }
 
     public static boolean checkVerificationIsPossible(User agent, Name target) {
-        try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT 1 FROM `notary` where `to`=? and `from`=? and `method` = ? ::`notaryType` AND `deleted` IS NULL AND `when` > (now() - interval '1 days' * ?)")) {
+        try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT 1 FROM `notary` where `to`=? and `from`=? and `method` = ? ::`notaryType` AND `deleted` IS NULL AND `when` > (now() - interval '1 days' * ?::INTEGER)")) {
             ps.setInt(1, target.getId());
             ps.setInt(2, agent.getId());
             ps.setEnum(3, VerificationType.FACE_TO_FACE);