-
-
Save ciiqr/11195439 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getUserShardId(authToken, userStore): | |
""" | |
Get the User from userStore and return the user's shard ID | |
""" | |
try: | |
user = userStore.getUser(authToken) | |
except (Errors.EDAMUserException, Errors.EDAMSystemException), e: | |
print "Exception while getting user's shardID:" | |
print type(e), e | |
return None | |
if hasattr(user, 'shardId'): | |
return user.shardId | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment