(request)
return False if from_demo_user(form_json) else True
If IGNORE_ALL_DEMO_USER_SUBMISSIONS is True then ignore submission if from demo user.
    Else
    If submission request.GET has `submit_mode=demo` and submitting user is not demo_user,
    the submissions should be ignored
If IGNORE_ALL_DEMO_USER_SUBMISSIONS is True then ignore submission if from demo user.
    Else
    If submission request.GET has `submit_mode=demo` and submitting user is not demo_user,
    the submissions should be ignored
If IGNORE_ALL_DEMO_USER_SUBMISSIONS is True then ignore submission if from demo user . Else If submission request . GET has submit_mode = demo and submitting user is not demo_user the submissions should be ignored
def should_ignore_submission(request):
    """
    If IGNORE_ALL_DEMO_USER_SUBMISSIONS is True then ignore submission if from demo user.
    Else
    If submission request.GET has `submit_mode=demo` and submitting user is not demo_user,
    the submissions should be ignored
    """
    form_json = None
    if settings.IGNORE_ALL_DEMO_USER_SUBMISSIONS:
        instance, _ = couchforms.get_instance_and_attachment(request)
        try:
            form_json = convert_xform_to_json(instance)
        except couchforms.XMLSyntaxError:
            # let the usual workflow handle response for invalid xml
            return False
        else:
            form_meta = form_json.get('meta')
            if form_meta and _submitted_by_demo_user(form_meta, request.domain):
                _notify_submission_if_applicable(request, form_meta)
                return True

    if not request.GET.get('submit_mode') == DEMO_SUBMIT_MODE:
        return False

    if form_json is None:
        instance, _ = couchforms.get_instance_and_attachment(request)
        form_json = convert_xform_to_json(instance)
    return False if from_demo_user(form_json) else True
def should_ignore_submission ( request ) : form_json = None if settings . IGNORE_ALL_DEMO_USER_SUBMISSIONS : instance , _ = couchforms . get_instance_and_attachment ( request ) try : form_json = convert_xform_to_json ( instance ) except couchforms . XMLSyntaxError : # let the usual workflow handle response for invalid xml return False else : form_meta = form_json . get ( 'meta' ) if form_meta and _submitted_by_demo_user ( form_meta , request . domain ) : _notify_submission_if_applicable ( request , form_meta ) return True if not request . GET . get ( 'submit_mode' ) == DEMO_SUBMIT_MODE : return False if form_json is None : instance , _ = couchforms . get_instance_and_attachment ( request ) form_json = convert_xform_to_json ( instance ) return False if from_demo_user ( form_json ) else True