librelist archives

« back to archive

ignore some endpoing in before_request validation

ignore some endpoing in before_request validation

From:
Jose Ayerdis
Date:
2013-01-14 @ 07:27
Hi I am trying to do some validation of the format of my json, depending on
the endpoint but some I would like to skip this validation I have try to
return None as an object in


@app.before_request
def validate_request():
#ignore items validation if login or logout
if request.endpoint == 'user.login':
 return None
        MORE CHUNKS OF VALIDATION HERE


But does not seem to be working any advice?

PD. I know it enters the condition that returns None.

Sincerly yours,

[Jose Luis Ayerdis Espinoza]
Necronet.info |
LinkedIn<http://www.linkedin.com/pub/jose-luis-ayerdis-espinoza/28/7b4/704>|
Careers
StackOverflow <http://careers.stackoverflow.com/necronet>

Re: ignore some endpoing in before_request validation

From:
Jose Ayerdis
Date:
2013-01-14 @ 08:13
I have been founding that writing here magically light the bull to know
what was going on, and it was a problem inside the endpoint method.


Next time I'll try to do

http://en.wikipedia.org/wiki/Rubber_duck_debugging


Sorry and thanks!!

Sincerly yours,

[Jose Luis Ayerdis Espinoza]
Necronet.info |
LinkedIn<http://www.linkedin.com/pub/jose-luis-ayerdis-espinoza/28/7b4/704>|
Careers
StackOverflow <http://careers.stackoverflow.com/necronet>


2013/1/14 Jose Ayerdis <joseayerdis@gmail.com>

> Hi I am trying to do some validation of the format of my json, depending
> on the endpoint but some I would like to skip this validation I have try to
> return None as an object in
>
>
> @app.before_request
> def validate_request():
> #ignore items validation if login or logout
> if request.endpoint == 'user.login':
>  return None
>         MORE CHUNKS OF VALIDATION HERE
>
>
> But does not seem to be working any advice?
>
> PD. I know it enters the condition that returns None.
>
> Sincerly yours,
>
> [Jose Luis Ayerdis Espinoza]
> Necronet.info | 
LinkedIn<http://www.linkedin.com/pub/jose-luis-ayerdis-espinoza/28/7b4/704>|
Careers
> StackOverflow <http://careers.stackoverflow.com/necronet>
>