[snowy] Make oauth endpoings csrf-exempt, enabling Django 1.2 support



commit 0351b2a911fedca08117355711bdb168bbbc96d8
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Tue Sep 14 00:09:09 2010 -0700

    Make oauth endpoings csrf-exempt, enabling Django 1.2 support
    
    This fix has been applied in prencher's piston fork,
    which will be piston 0.3
    
    Quick fix for https://bugzilla.gnome.org/show_bug.cgi?id=629715

 lib/piston/authentication.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lib/piston/authentication.py b/lib/piston/authentication.py
index 7d09707..63bec85 100644
--- a/lib/piston/authentication.py
+++ b/lib/piston/authentication.py
@@ -12,6 +12,9 @@ from django.core.exceptions import ImproperlyConfigured
 from django.shortcuts import render_to_response
 from django.template import RequestContext
 
+#TODO: Update to proper 1.2 imports (once we drop 1.1 support)
+from django.contrib.csrf.middleware import csrf_exempt
+
 from piston import forms
 
 class NoAuthentication(object):
@@ -150,6 +153,7 @@ def send_oauth_error(err=None):
 
     return response
 
+ csrf_exempt
 def oauth_request_token(request):
     oauth_server, oauth_request = initialize_server_request(request)
     
@@ -221,6 +225,7 @@ def oauth_user_auth(request):
             
     return response
 
+ csrf_exempt
 def oauth_access_token(request):
     oauth_server, oauth_request = initialize_server_request(request)
     



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]