(webuser, analytics_enabled)
Set 'opted_out' on the user whenever they change that, so we don't have
    opted out users throwing off metrics. This is handled separately because we
    (ironically) ignore the analytics_enabled flag.
Set 'opted_out' on the user whenever they change that, so we don't have
    opted out users throwing off metrics. This is handled separately because we
    (ironically) ignore the analytics_enabled flag.
Set opted_out on the user whenever they change that so we don t have opted out users throwing off metrics . This is handled separately because we ( ironically ) ignore the analytics_enabled flag .
def set_analytics_opt_out(webuser, analytics_enabled):
    """
    Set 'opted_out' on the user whenever they change that, so we don't have
    opted out users throwing off metrics. This is handled separately because we
    (ironically) ignore the analytics_enabled flag.
    """
    _hubspot_post(
        url="https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/{}".format(
            six.moves.urllib.parse.quote(webuser.get_email())
        ),
        data=json.dumps(
            {'properties': [
                {'property': 'analytics_disabled', 'value': not analytics_enabled}
            ]}
        ),
    )
def set_analytics_opt_out ( webuser , analytics_enabled ) : _hubspot_post ( url = "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/{}" . format ( six . moves . urllib . parse . quote ( webuser . get_email ( ) ) ) , data = json . dumps ( { 'properties' : [ { 'property' : 'analytics_disabled' , 'value' : not analytics_enabled } ] } ) , )