You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Dave Brondsema <br...@users.sf.net> on 2013/11/04 16:31:06 UTC

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



---

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

**Status:** open
**Created:** Mon Nov 04, 2013 03:31 PM UTC by Dave Brondsema
**Last Updated:** Mon Nov 04, 2013 03:31 PM UTC
**Owner:** nobody

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.

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

Posted by Dave Brondsema <br...@users.sf.net>.
- **status**: open --> code-review
- **assigned_to**: Dave Brondsema



---

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

**Status:** code-review
**Created:** Mon Nov 04, 2013 03:31 PM UTC by Dave Brondsema
**Last Updated:** Mon Nov 04, 2013 03:31 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.

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

Posted by Tim Van Steenburgh <va...@users.sf.net>.
- **QA**: Tim Van Steenburgh



---

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

**Status:** code-review
**Created:** Mon Nov 04, 2013 03:31 PM UTC by Dave Brondsema
**Last Updated:** Mon Nov 04, 2013 09:13 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.

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

Posted by Dave Brondsema <br...@users.sf.net>.
allura:db/6835 and forge-classic:db/6835


---

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

**Status:** code-review
**Created:** Mon Nov 04, 2013 03:31 PM UTC by Dave Brondsema
**Last Updated:** Mon Nov 04, 2013 03:31 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.

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

Posted by Tim Van Steenburgh <va...@users.sf.net>.
- **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.