Commit 7bccc9a5 authored by root's avatar root
Browse files

Check whether account is already uuid before transforming

parent d1d66c06
......@@ -276,6 +276,13 @@ def update_manifest_meta(request, v_account, meta):
md5.update(etag)
meta['checksum'] = md5.hexdigest().lower()
def is_uuid(str):
try:
uuid.UUID(str)
except ValueError:
return False
else:
return True
def retrieve_username(uuid):
try:
......@@ -286,6 +293,8 @@ def retrieve_username(uuid):
return uuid
def retrieve_uuid(username):
if is_uuid(username):
return username
try:
return get_user_uuid(
SERVICE_TOKEN, username, USER_INFO_URL, AUTHENTICATION_USERS)
......
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