Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#33337 closed Bug (invalid)

Part of admin template is ignored when deploying

Reported by: xtlc Owned by: nobody
Component: Template system Version: 3.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by xtlc)

I already opened an unanswered post on 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:

https://i.stack.imgur.com/YIOBJ.png

but when setting DEBUG= False:

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.

Change History (2)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: invalid
Status: newclosed

Please don't use Trac as a support channel. Closing per TicketClosingReasons/UseSupportChannels.

comment:2 by xtlc, 3 years ago

Description: modified (diff)

removed some irrelevant code parts.

Last edited 3 years ago by xtlc (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top