esme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Hirsch <hirsch.d...@gmail.com>
Subject [RELEASE] ESME-132 Signup using username that already exists doesn't result in an error message
Date Sun, 07 Feb 2010 10:37:21 GMT
Hi,

I did some quick hacking regarding this bug.

scala routines in User.scala are being called but they are either not
working correctly or their results are not be displayed.   The
information from the upw_sign_form.html are working correctly and the
reason why the messages for the bottom half of the signup page are
displayed is unknown.  One reason may be that the lift:msg tags (for
example, <lift:msg id="nickname"/>) are missing from the signup.html
file. I added them but it still doesn't work.

Maybe someone else can take a look and see if they see what the prob is.

D.

---------------

User.scala

    private def validateNickname(str: String): List[FieldError] = {
      val others = getSingleton.findByNickname(str).
      // getSingleton.findAll(By(getSingleton.nickname, str)).
      filter(_.id.is != fieldOwner.id.is)
      others.map(u => FieldError(this, <xml:group>Duplicate nickname:
{str}</xml:group>))
    }

    private def validText(str: String): List[FieldError] =
    if (ValidNickName(str)) Nil
    else List(FieldError(this,
                         <xml:group>Invalid nickname.  Must start with
          a letter and contain only letters,
          numbers or "_"</xml:group>))

    override def validations = validText _ :: validateNickname _ ::
super.validations

signup.html

         <label for="nickname">
                            <lift:loc>ui_sign_up_nickname</lift:loc>
                            <br/>
                            <signup:nickname/> <lift:msg id="nickname"/>
                        </label>

lift:msg tags are missing

Mime
View raw message