Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def user_mediacloud_client():
'''
Return a mediacloud client for the logged in user
'''
user_mc_key = user_mediacloud_key()
user_mc = mediacloud.api.MediaCloud(user_mc_key)
return user_mc
def user_mediacloud_client(user_mc_key=None):
# Return a mediacloud client for the logged in user. Passing in a key lets you ovveride reading it out
# of the request object (which you might not have access to)
mc_key_to_use = user_mc_key
if mc_key_to_use is None:
mc_key_to_use = user_mediacloud_key()
user_mc = mediacloud.api.MediaCloud(mc_key_to_use)
return user_mc
def _get_user_profile(key):
user_mc = mediacloud.api.MediaCloud(key)
profile = user_mc.userProfile()
return profile