]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/dbObjects/User.java
fix: correct validation of minimum and maximum ages
[gigi.git] / src / club / wpia / gigi / dbObjects / User.java
index b65dbc5a027f5edee63c301b3dd12cd42f661957..cdd00d6f3533b2ba7656203a960f4014aad426d7 100644 (file)
@@ -167,7 +167,7 @@ public class User extends CertificateOwner {
                 throw new GigiApiException("Entered date of birth is below the restricted age requirements.");
             }
 
-            if (CalendarUtil.isOfAge(dob, User.MAXIMUM_PLAUSIBLE_AGE)) {
+            if (CalendarUtil.isYearsInFuture(dob.end(), User.MAXIMUM_PLAUSIBLE_AGE)) {
                 throw new GigiApiException("Entered date of birth exceeds the maximum age set in our policies. Please check your DoB is correct and contact support if the issue persists.");
             }
             this.dob = dob;