def add_data_sharing_consent_field(request, form_desc):
 enterprise_customer = get_enterprise_customer_for_request(request)
 required = data_sharing_consent_required_at_login(request)
 if (not data_sharing_consent_requested(request)):
  return
 label = _('I agree to allow {platform_name} to share data about my enrollment, completion and performance in all {platform_name} courses and programs where my enrollment is sponsored by {ec_name}.').format(platform_name=configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME), ec_name=enterprise_customer.name)
 error_msg = _('To link your account with {ec_name}, you are required to consent to data sharing.').format(ec_name=enterprise_customer.name)
 form_desc.add_field('data_sharing_consent', label=label, field_type='checkbox', default=False, required=required, error_messages={'required': error_msg})

def add_data_sharing_consent_field ( request , form_desc ) : enterprise_customer = get_enterprise_customer_for_request ( request ) required = data_sharing_consent_required_at_login ( request ) if ( not data_sharing_consent_requested ( request ) ) : return label = _ ( 'I agree to allow {platform_name} to share data about my enrollment, completion and performance in all {platform_name} courses and programs where my enrollment is sponsored by {ec_name}.' ) . format ( platform_name = configuration_helpers . get_value ( 'PLATFORM_NAME' , settings . PLATFORM_NAME ) , ec_name = enterprise_customer . name ) error_msg = _ ( 'To link your account with {ec_name}, you are required to consent to data sharing.' ) . format ( ec_name = enterprise_customer . name ) form_desc . add_field ( 'data_sharing_consent' , label = label , field_type = 'checkbox' , default = False , required = required , error_messages = { 'required' : error_msg } )
adds a checkbox field to be selected if the user consents to share data with the enterprisecustomer attached to the sso provider with which theyre authenticating .