コード例 #1
0
def get_success_msg_for_ds_registration_using(response, source, form_model=None):
    thanks = get_registration_success_message(response)
    if source == "sms":
        message_with_response_text = thanks + " " + ResponseBuilder(form_model=form_model,
                                                                    processed_data=response.processed_data).get_expanded_response()
        return message_with_response_text if len(
            message_with_response_text) <= 160 else thanks + " " + get_subject_info(response, form_model)
    return _("Registration successful.") + " %s %s" % (_("ID is:"), response.short_code)
コード例 #2
0
def get_success_msg_for_submission_using(response, form_model, dbm, request):
    from datawinners.messageprovider.handlers import success_questionnaire_submission_handler
    datasender_name = response.reporters[0].get('name').split()[0].capitalize() if response.reporters else ''
    answers_response_text = ResponseBuilder(form_model=form_model,
                                    processed_data=response.processed_data).get_expanded_response()
    message = success_questionnaire_submission_handler(dbm, form_model.form_code, datasender_name, answers_response_text, request)

    return message
コード例 #3
0
def get_success_msg_for_submission_using(response, form_model):
    message = get_submission_success_message(response, form_model)
    response_text = ResponseBuilder(
        form_model=form_model,
        processed_data=response.processed_data).get_expanded_response()
    message_with_response_text = message + ": " + response_text

    return message_with_response_text if len(
        message_with_response_text) <= 160 else message + "."
コード例 #4
0
def get_success_msg_for_subject_registration_using(dbm,response,form_model=None):
    from datawinners.messageprovider.handlers import success_subject_registration_handler
    ds_name = response.reporters[0].get('name')
    datasender_name = ds_name.split()[0].capitalize() if ds_name else ''
    answers_response_text = ResponseBuilder(form_model=form_model,
                                    processed_data=response.processed_data).get_response_for_sms_subject_registration()
    message = success_subject_registration_handler(dbm, datasender_name, answers_response_text)

    return message
コード例 #5
0
def get_success_msg_for_registration_using(response, source, form_model=None):
    resp_string = (_("ID is:") + " %s") % (response.short_code, )

    thanks = get_registration_success_message() % resp_string
    if source == "sms":
        return thanks + ResponseBuilder(
            form_model=form_model,
            processed_data=response.processed_data).get_expanded_response()
    return thanks