Commit d1b8e7d5 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Store user.uuid instead of user.email in quotaholder

parent b34d5588
......@@ -109,6 +109,7 @@ def authenticate_old(request, user=None):
user_info = {
'id': user.id,
'username': user.username,
'uuid': user.uuid,
'uniq': user.email,
'auth_token': user.auth_token,
'auth_token_created': user.auth_token_created.isoformat(),
......@@ -147,6 +148,7 @@ def authenticate(request, user=None):
user_info = {
'id': user.id,
'userid': user.username,
'uuid': user.uuid,
'email': [user.email],
'name': user.realname,
'auth_token': user.auth_token,
......
......@@ -76,7 +76,7 @@ def call(func_name):
if not QUOTAHOLDER_URL:
return ()
c = get_client()
c = get_client()
func = c.__dict__.get(func_name)
if not func:
return ()
......@@ -108,7 +108,7 @@ def send_quota(users):
export_limit = None
flags = 0
args = (
user.email, resource, key, quantity, capacity, import_limit,
user.uuid, resource, key, quantity, capacity, import_limit,
export_limit, flags)
append(args)
return data
......@@ -193,7 +193,7 @@ def get_quota(users):
append = data.append
for user in users:
try:
entity = user.email
entity = user.uuid
except AttributeError:
continue
else:
......@@ -222,7 +222,7 @@ def create_entities(entities, field=''):
def register_users(users):
users, copy = itertools.tee(users)
rejected = create_entities(entities=users, field='email')
rejected = create_entities(entities=users, field='uuid')
created = (e for e in copy if unicode(e) not in rejected)
return send_quota(created)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment