def get_user_credentials(user):
 credential_configuration = CredentialsApiConfig.current()
 user_query = {u'status': u'awarded', u'username': user.username}
 use_cache = (credential_configuration.is_cache_enabled and (not user.is_staff))
 cache_key = (((credential_configuration.CACHE_KEY + u'.') + user.username) if use_cache else None)
 credentials = get_edx_api_data(credential_configuration, user, u'credentials', querystring=user_query, cache_key=cache_key)
 return credentials

def get_user_credentials ( user ) : credential_configuration = CredentialsApiConfig . current ( ) user_query = { u'status' : u'awarded' , u'username' : user . username } use_cache = ( credential_configuration . is_cache_enabled and ( not user . is_staff ) ) cache_key = ( ( ( credential_configuration . CACHE_KEY + u'.' ) + user . username ) if use_cache else None ) credentials = get_edx_api_data ( credential_configuration , user , u'credentials' , querystring = user_query , cache_key = cache_key ) return credentials
given a user .