From 94246f6fcedf8e08a63084482451587793f6a76c Mon Sep 17 00:00:00 2001 From: Mikkel Madsen Date: Sun, 11 May 2014 22:10:46 +0200 Subject: [PATCH] Use username minimum length from config in model There is a configuration parameter for setting the minimum username length, but the model has a hardcoded minimum of 4. This is an issue if you need usernames shorter than 4. --- grails-app/domain/grails/plugin/nimble/core/UserBase.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grails-app/domain/grails/plugin/nimble/core/UserBase.groovy b/grails-app/domain/grails/plugin/nimble/core/UserBase.groovy index 1a73d65..e12acb4 100644 --- a/grails-app/domain/grails/plugin/nimble/core/UserBase.groovy +++ b/grails-app/domain/grails/plugin/nimble/core/UserBase.groovy @@ -53,8 +53,9 @@ class UserBase implements Serializable { } static constraints = { - username(blank: false, unique: true, minSize: 4, maxSize: 255) - passwordHash(nullable: true, blank: false) + username(blank: false, unique: true, maxSize: 255, + minSize: ConfigurationHolder.config.nimble.localusers.usernames.minlength) + passwordHash(nullable: true, blank: false actionHash(nullable: true, blank: false) realm(nullable: true, blank: false) expiration(nullable: true)