components/python/django_openstack_auth/patches/02-launchpad-1451934.patch
changeset 5405 66fd59fecd68
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/django_openstack_auth/patches/02-launchpad-1451934.patch	Fri Feb 05 17:54:17 2016 -0500
@@ -0,0 +1,40 @@
+From d19c032abf932a6afc49423dc096fa8238e62687 Mon Sep 17 00:00:00 2001
+From: lin-hua-cheng <[email protected]>
+Date: Tue, 5 May 2015 10:07:45 -0700
+Subject: Set default value for new token attributes
+
+Two new attributes were recently added to token object:
+'unscoped_token' and 'is_federated'. When performing an
+upgrade, the existing token object stored in the session
+will not have the two attributes yet.  This patch fixes
+the issue by providing a default value so it won't interrupt
+service for existing login user during an upgrade.
+
+This fix is included in django_openstack_auth 1.3.0
+
+Change-Id: I6adf974876294168e2326b5e10c14da2dd3e52ea
+Closes-bug: #1451934
+(cherry picked from commit d8f5c949df8adea1e932e9ff3d1f39a1af014d16)
+---
+ openstack_auth/user.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/openstack_auth/user.py b/openstack_auth/user.py
+index 811fe84..132e37b 100644
+--- a/openstack_auth/user.py
++++ b/openstack_auth/user.py
+@@ -55,8 +55,9 @@ def create_user_from_token(request, token, endpoint, services_region=None):
+                 roles=token.roles,
+                 endpoint=endpoint,
+                 services_region=svc_region,
+-                is_federated=token.is_federated,
+-                unscoped_token=token.unscoped_token)
++                is_federated=getattr(token, 'is_federated', False),
++                unscoped_token=getattr(token, 'unscoped_token',
++                                       request.session.get('unscoped_token')))
+ 
+ 
+ class Token(object):
+-- 
+cgit v0.11.2
+