summaryrefslogtreecommitdiffstats
path: root/keystone/db
diff options
context:
space:
mode:
authorSai Krishna <saikrishna1511@gmail.com>2011-05-12 16:34:38 +0530
committerSai Krishna <saikrishna1511@gmail.com>2011-05-12 16:34:38 +0530
commite199cb4541a70709d94deab86657bbde487037e6 (patch)
treeffb455d72fc9b8ca072851b8e57806c1060993b7 /keystone/db
parentc98c32d0f1ee4d6f2fd13fad37e9abd0e8801362 (diff)
parenta0c43a05126d9cca83b58b788fbc8e24f004fb66 (diff)
Merge branch 'master' of https://git.hcleai.com/keystone
Conflicts: README
Diffstat (limited to 'keystone/db')
-rw-r--r--keystone/db/sqlalchemy/api.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/keystone/db/sqlalchemy/api.py b/keystone/db/sqlalchemy/api.py
index f1817a24..9fd9a734 100644
--- a/keystone/db/sqlalchemy/api.py
+++ b/keystone/db/sqlalchemy/api.py
@@ -471,6 +471,13 @@ def token_for_user(user_id, session=None):
return result
+def token_for_user_tenant(user_id, tenant_id, session=None):
+ if not session:
+ session = get_session()
+ result = session.query(models.Token).filter_by(
+ user_id=user_id, tenant_id=tenant_id).order_by("expires desc").first()
+ return result
+
def user_tenant_create(values):
user_tenant_ref = models.UserTenantAssociation()
user_tenant_ref.update(values)