Issue 50 in google-app-engine-oil: before_action halt execution

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 7, 2009, 9:11:17 AM12/7/09
to google-app...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 50 by Martin.C.Simpson: before_action halt execution
http://code.google.com/p/google-app-engine-oil/issues/detail?id=50

What steps will reproduce the problem
1. Create a class with a before filter that has self.redirect("/")
2. Create a method that makes a change in the database
3. Invoke that method via your browser

What is the expected output? What do you see instead?
Expected output is a 301 moved. What actually happens is I see a 301 moved
BUT the code on the method still gets executed, rather than being
redirected before the method is invoked.

What version of the product are you using? On what operating system?
0.3, OSX

Please provide any additional information below.
Essentially, we just need to be able to tell GAEO to not invoke a method if
self.exit() is called in the before filter or something similar.

p.s what does it take to become a commiter to this project?


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Dec 7, 2009, 9:15:22 AM12/7/09
to google-app...@googlegroups.com

Comment #1 on issue 50 by Martin.C.Simpson: before_action halt execution
http://code.google.com/p/google-app-engine-oil/issues/detail?id=50

The reason this is important is, I am doing login validation checks against
the
before filter and want to redirect a user away from the method before it is
invoked
if they are not logged in.

Thanks

Martin

codesite...@google.com

unread,
Dec 7, 2009, 10:25:25 AM12/7/09
to google-app...@googlegroups.com
Updates:
Status: Invalid

Comment #2 on issue 50 by ericsk: before_action halt execution
http://code.google.com/p/google-app-engine-oil/issues/detail?id=50

Do you call `return False` in the before_action() ?
While you returned False in before_action, the remain code would not be
executed.

e.g.,
...
def before_action(self):
# do something
self.redirect('/')
return False

codesite...@google.com

unread,
Dec 7, 2009, 10:56:07 AM12/7/09
to google-app...@googlegroups.com

Comment #3 on issue 50 by Martin.C.Simpson: before_action halt execution
http://code.google.com/p/google-app-engine-oil/issues/detail?id=50

Brilliant, I couldn't find this anywhere in the documentation. Thanks for
that!
Reply all
Reply to author
Forward
0 new messages