incubator-allura-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Van Steenburgh" <vansteenbu...@users.sf.net>
Subject [allura:tickets] #6835 @validate decorators without if_invalid or error checking are useless
Date Thu, 07 Nov 2013 16:40:58 GMT
- **status**: code-review --> closed



---

** [tickets:#6835] @validate decorators without if_invalid or error checking are useless**

**Status:** closed
**Created:** Mon Nov 04, 2013 03:31 PM UTC by Dave Brondsema
**Last Updated:** Thu Nov 07, 2013 04:32 PM UTC
**Owner:** Dave Brondsema

A URL like this /p/.../discussion/general/?limit=1&page=2x generates this error:

~~~~
 Module forgediscussion.controllers.forum:102 in index         view
>>  limit, page, start = g.handle_paging(limit, page)
Module allura.lib.app_globals:359 in handle_paging         view
>>  page = max(int(page), 0)
ValueError: invalid literal for int() with base 10: '2x'
~~~~

despite having `@validate(dict(page=validators.Int(if_empty=0),` on the controller, because
all that @validate does is determine if there are errors and sets them up on the template
context for the controller/template to handle.  On form submissions, the form is normally
set up to show error messages, but if that's not set up nothing happens - e.g. handling GET
url parameters.

We should have if_invalid=0 on the validator.



---

Sent from sourceforge.net because allura-dev@incubator.apache.org is subscribed to https://sourceforge.net/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/allura/admin/tickets/options.
 Or, if this is a mailing list, you can unsubscribe from the mailing list.
Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message