def _update_email_opt_in(request, org):
 email_opt_in = request.POST.get('email_opt_in')
 if (email_opt_in is not None):
  email_opt_in_boolean = (email_opt_in == 'true')
  preferences_api.update_email_opt_in(request.user, org, email_opt_in_boolean)

def _update_email_opt_in ( request , org ) : email_opt_in = request . POST . get ( 'email_opt_in' ) if ( email_opt_in is not None ) : email_opt_in_boolean = ( email_opt_in == 'true' ) preferences_api . update_email_opt_in ( request . user , org , email_opt_in_boolean )
helper function used to hit the profile api if email opt-in is enabled .