From cc70c4ff870987bbac9ea5f8be6944608d7272cc Mon Sep 17 00:00:00 2001
From: Ben Adida <ben@adida.net>
Date: Mon, 26 Jan 2015 01:48:04 +0000
Subject: [PATCH] removed old pdb's and fixed csrf token setting to consider
 unicode

---
 helios/datatypes/legacy.py                      | 2 +-
 helios_auth/auth_systems/openid/view_helpers.py | 1 -
 helios_auth/security/__init__.py                | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/helios/datatypes/legacy.py b/helios/datatypes/legacy.py
index 766ed92..c0a24ff 100644
--- a/helios/datatypes/legacy.py
+++ b/helios/datatypes/legacy.py
@@ -176,7 +176,7 @@ class DLogProof(LegacyObject):
 
     def __init__(self, wrapped_obj):
         if isinstance(wrapped_obj, dict):
-            import pdb; pdb.set_trace()
+            raise Exception("problem with dict")
 
         super(DLogProof,self).__init__(wrapped_obj)
 
diff --git a/helios_auth/auth_systems/openid/view_helpers.py b/helios_auth/auth_systems/openid/view_helpers.py
index cfdb4e6..06eef8a 100644
--- a/helios_auth/auth_systems/openid/view_helpers.py
+++ b/helios_auth/auth_systems/openid/view_helpers.py
@@ -65,7 +65,6 @@ def start_openid(session, openid_url, trust_root, return_to):
         error = "OpenID discovery error: %s" % (str(e),)
 
     if error:
-        import pdb; pdb.set_trace()
         raise Exception("error in openid")
 
     # Add Simple Registration request information.  Some fields
diff --git a/helios_auth/security/__init__.py b/helios_auth/security/__init__.py
index 373c9da..b036067 100644
--- a/helios_auth/security/__init__.py
+++ b/helios_auth/security/__init__.py
@@ -95,7 +95,7 @@ def get_user(request):
   # request.session.set_expiry(settings.SESSION_COOKIE_AGE)
   
   # set up CSRF protection if needed
-  if not request.session.has_key('csrf_token') or type(request.session['csrf_token']) != str:
+  if not request.session.has_key('csrf_token') or (type(request.session['csrf_token']) != str and type(request.session['csrf_token']) != unicode):
     request.session['csrf_token'] = str(uuid.uuid4())
 
   if request.session.has_key('user'):
-- 
GitLab