(form_id, request, user=None, extra_fields=None)
pulls out relevant info from request object before sending to celery since
    requests cannot be pickled
pulls out relevant info from request object before sending to celery since
    requests cannot be pickled
pulls out relevant info from request object before sending to celery since requests cannot be pickled
def send_hubspot_form(form_id, request, user=None, extra_fields=None):
    """
    pulls out relevant info from request object before sending to celery since
    requests cannot be pickled
    """
    if user is None:
        user = getattr(request, 'couch_user', None)
    if request and user and user.is_web_user():
        meta = get_meta(request)
        send_hubspot_form_task.delay(
            form_id, user.user_id, request.COOKIES.get(HUBSPOT_COOKIE),
            meta, extra_fields=extra_fields
        )
def send_hubspot_form ( form_id , request , user = None , extra_fields = None ) : if user is None : user = getattr ( request , 'couch_user' , None ) if request and user and user . is_web_user ( ) : meta = get_meta ( request ) send_hubspot_form_task . delay ( form_id , user . user_id , request . COOKIES . get ( HUBSPOT_COOKIE ) , meta , extra_fields = extra_fields )