Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29456 closed Bug (invalid)

Django 1.11 same filter_list get redisplayed in different model admin page

Reported by: grpoundblue Owned by: nobody
Component: contrib.admin Version: 1.11
Severity: Normal Keywords: list_filter
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm getting this behavior after updating Django from 1.8 to 1.11.

modelAAdmin(admin.ModelAdmin)
     list_filter = ('filter_a',)

modelBAdmin(admin.ModelAdmin)
     list_filter = ('filter_b',)

If I navigate to modelA admin page first and than move to modelB admin page the filters defined in modelA are displayed instead of the modelB's one.
Making a selection on the wrongly displayed filter appends ?e=1 and no error displayed.
This also happen if there is more than two model admin classes.

Change History (3)

comment:1 by Carlton Gibson, 6 years ago

Resolution: needsinfo
Status: newclosed

Hi @grpoundblue.

This needs extra info as is — I can't reproduce it. Can you provide a minimal steps to reproduce or test project that demonstrates the issue?

Thanks.

comment:2 by grpoundblue, 6 years ago

Finally I was able to get rid of this weird behavior, honestly without investigating further. However I put this here hopefully someone can figure it out the exact cause.
I had a custom template for change_list.html like below, the motivation was to increase performance in page loading :

PROJECT_HOME/myapp/templates/admin/myapp/change_list.html

The file's content was :

{% extends "admin/change_list.html" %}
{% load admin_list i18n cache %}

{% block filters %}
<!-- BETTER FILTER, date doesn't change a lot -->
    {% cache 300 admin_filters request.GET.items request.path request.user.username %}
        {% if cl.has_filters %}
          <div id="grp-filters" class="grp-module grp-filter testTEST">
            <h2>{% trans 'Filter' %}</h2>
            {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
          </div>
        {% endif %}
    {% endcache %}
{% endblock %}

So I just removed this custom template.

Version 0, edited 6 years ago by grpoundblue (next)

comment:3 by Tim Graham, 6 years ago

Resolution: needsinfoinvalid
Note: See TracTickets for help on using tickets.
Back to Top