Consider old version of token without 'user_domain_name' attr

Closes-Bug: #1363515
Change-Id: I252b99fba3c48a7ed27af1b7da3b1cb037555eb8
This commit is contained in:
Akihiro Motoki
2014-08-31 07:18:20 +09:00
parent 0a0db68468
commit 5c8b0c78f2

View File

@@ -40,7 +40,9 @@ def create_user_from_token(request, token, endpoint, services_region=None):
token=token,
user=token.user['name'],
user_domain_id=token.user_domain_id,
user_domain_name=token.user_domain_name,
# We need to consider already logged-in users with an old
# version of Token without user_domain_name.
user_domain_name=getattr(token, 'user_domain_name', None),
project_id=token.project['id'],
project_name=token.project['name'],
domain_id=token.domain['id'],