Comment 1 for bug 451424

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 451424] [NEW] LaunchpadForm should let you specify if multiply-supplied fields are OK or not

On Wed, Oct 14, 2009 at 04:51:59PM -0000, Julian Edwards wrote:
> Public bug reported:
>
> If someone specifies a GET request like this (possibly by URL hacking ):
>
> ?name_filter=blah&name_filter=wheee
>
> then retrieving the field from the form with code like this:
>
> self.request.get('name_filter')
>
> will return a list instead of an expected string. There should be a
> more generic way to say whether this is acceptable to the form, and
> gracefully reject such requests if not.

You mean something like self.request.form_ng.getOne('name_filter'),
which raises UnexpectedFormData if there is more than one value?

    subscribe bjornt
    status incomplete