(xform)
return reverse("app_download_file", args=[
        xform.domain,
        xform.build_id,
        app.get_form_filename(module=form.get_module(), form=form),
    ])
Returns the download url for the form source for a submitted XForm
Returns the download url for the form source for a submitted XForm
Returns the download url for the form source for a submitted XForm
def get_form_source_download_url(xform):
    """Returns the download url for the form source for a submitted XForm
    """
    if not xform.build_id:
        return None

    try:
        app = get_app(xform.domain, xform.build_id)
    except Http404:
        return None
    if app.is_remote_app():
        return None

    try:
        form = app.get_forms_by_xmlns(xform.xmlns)[0]
    except IndexError:
        return None

    return reverse("app_download_file", args=[
        xform.domain,
        xform.build_id,
        app.get_form_filename(module=form.get_module(), form=form),
    ])
def get_form_source_download_url ( xform ) : if not xform . build_id : return None try : app = get_app ( xform . domain , xform . build_id ) except Http404 : return None if app . is_remote_app ( ) : return None try : form = app . get_forms_by_xmlns ( xform . xmlns ) [ 0 ] except IndexError : return None return reverse ( "app_download_file" , args = [ xform . domain , xform . build_id , app . get_form_filename ( module = form . get_module ( ) , form = form ) , ] )