﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33337	Part of admin template is ignored when deploying	xtlc	nobody	"I already opened an unanswered post on [https://stackoverflow.com/questions/69928094/admin-template-is-ignored-when-deploying Stackoverflow], which is the reason why I come here:

I changed the `change_form.html` and the `submit_line.html` template within one of my projects. The `change_form.html` now reads:

{{{

{% extends ""admin/change_form.html"" %}
{% load i18n admin_urls %}

{% block inline_field_sets %}
    {% for inline_admin_formset in inline_admin_formsets %}
        {% include inline_admin_formset.opts.template %}
    {% endfor %}
    warning!
{% endblock %}
}}}

and the `submit_line.html`:

{{{
{% load i18n admin_urls %}
<div class=""submit-row"">
    {% if show_save %}<input type=""submit"" value=""{% trans 'Save' %}"" class=""default"" name=""_save"" />{% endif %}
    {% if show_delete_link %}
        {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
        <p class=""deletelink-box""><a href=""{% add_preserved_filters delete_url %}"" class=""deletelink"">{% trans ""Delete"" %}</a></p>
    {% endif %}
    {% if show_download_zip %}
        <input type=""submit"" value=""zip"" name=""_download_zip"" />
    {% endif %}
    {% if show_save_as_new %}
        <input type=""submit"" value=""{% trans 'Save as new' %}"" name=""_saveasnew"" />
    {% endif %}
    {% if show_save_and_add_another %}
        <input type=""submit"" value=""{% trans 'Save and add another' %}"" name=""_addanother"" />
    {% endif %}
    {% if show_save_and_continue %}
        <input type=""submit"" value=""{% trans 'Save and continue editing' %}"" name=""_continue"" />
    {% endif %}
</div>
}}}

In my corresponding admin class I added:

{{{
    def render_change_form(self, request, context, *args, **kwargs):
        if not context[""original""] == None:
            context.update({'show_download_CSV': True})
        return super().render_change_form(request, context, *args, **kwargs)
}}}

and now for the part that is bugging me. When `DEBUG = True` is set, the result looks like this:

[[Image(https://i.stack.imgur.com/YIOBJ.png)]]

but when setting `DEBUG= False`: 

[[Image(https://i.stack.imgur.com/U36Bp.png)]]

I can not see any errors what so ever. I do not know if this is a bug or maybe just a silly mistake on my side, but any help on what could be checked is appreciated. This was tested on 3.2.8.








"	Bug	closed	Template system	3.2	Normal	invalid			Unreviewed	0	0	0	0	0	0
