def _avatar_url_from_info(oauth_type, info):
    """Returns a URL for the user avatar, depending on oauth_type"""
    if oauth_type == 'facebook':
        return 'https://graph.facebook.com/{}/picture?type=square'.format(
            info['id'])
    elif oauth_type == 'google':
        return info.get('picture')
    return None