|
1 From d19c032abf932a6afc49423dc096fa8238e62687 Mon Sep 17 00:00:00 2001 |
|
2 From: lin-hua-cheng <[email protected]> |
|
3 Date: Tue, 5 May 2015 10:07:45 -0700 |
|
4 Subject: Set default value for new token attributes |
|
5 |
|
6 Two new attributes were recently added to token object: |
|
7 'unscoped_token' and 'is_federated'. When performing an |
|
8 upgrade, the existing token object stored in the session |
|
9 will not have the two attributes yet. This patch fixes |
|
10 the issue by providing a default value so it won't interrupt |
|
11 service for existing login user during an upgrade. |
|
12 |
|
13 This fix is included in django_openstack_auth 1.3.0 |
|
14 |
|
15 Change-Id: I6adf974876294168e2326b5e10c14da2dd3e52ea |
|
16 Closes-bug: #1451934 |
|
17 (cherry picked from commit d8f5c949df8adea1e932e9ff3d1f39a1af014d16) |
|
18 --- |
|
19 openstack_auth/user.py | 5 +++-- |
|
20 1 file changed, 3 insertions(+), 2 deletions(-) |
|
21 |
|
22 diff --git a/openstack_auth/user.py b/openstack_auth/user.py |
|
23 index 811fe84..132e37b 100644 |
|
24 --- a/openstack_auth/user.py |
|
25 +++ b/openstack_auth/user.py |
|
26 @@ -55,8 +55,9 @@ def create_user_from_token(request, token, endpoint, services_region=None): |
|
27 roles=token.roles, |
|
28 endpoint=endpoint, |
|
29 services_region=svc_region, |
|
30 - is_federated=token.is_federated, |
|
31 - unscoped_token=token.unscoped_token) |
|
32 + is_federated=getattr(token, 'is_federated', False), |
|
33 + unscoped_token=getattr(token, 'unscoped_token', |
|
34 + request.session.get('unscoped_token'))) |
|
35 |
|
36 |
|
37 class Token(object): |
|
38 -- |
|
39 cgit v0.11.2 |
|
40 |