pyfacebook icon indicating copy to clipboard operation
pyfacebook copied to clipboard

FacebookWSGIMiddleware doesn't work in Pylons v1.0

Open a13x opened this issue 15 years ago • 0 comments

Configuring pyfacebook with pylons doesn't work as following import of redirect_to silently fails: from pylons.controllers.util import redirect_to as pylons_redirect_to

Under Pylons v1.0 there's no redirect_to (it has been changed to redirect)

Here's the diff to fix the problem: diff --git a/facebook/wsgi.py b/facebook/wsgi.py index f6a790d..ea49e76 100644 --- a/facebook/wsgi.py +++ b/facebook/wsgi.py @@ -82,7 +82,7 @@ class FacebookWSGIMiddleware(object):

try: import pylons

  • from pylons.controllers.util import redirect_to as pylons_redirect_to
  • from pylons.controllers.util import redirect as pylons_redirect from routes import url_for except ImportError: pass @@ -112,7 +112,7 @@ else: """ if self.in_canvas: raise CanvasRedirect(url)
  •        pylons_redirect_to(url)
    
  •        pylons_redirect(url)
    
     def apps_url_for(self, *args, **kargs):
         """Like url_for, but starts with "http://apps.facebook.com"."""
    

a13x avatar Jun 21 '10 15:06 a13x