Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filters are not preserved after saving with confirmation #49

Open
CelestialStreamer opened this issue Jun 6, 2023 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@CelestialStreamer
Copy link

Describe the bug
After saving and confirming your actions, any filters which were present are not preserved. Normally in Django admin, if you use a filter (which adds something like ?foo=bar in the url), saving the model puts you back to the list view but remembers any filters you had previously used.

To Reproduce
Steps to reproduce the behavior:

  1. Got to listview in admin of any model which is using NesteModelAdmin.
  2. Filter results. Note how your url has something like /admin/app/model/?foo=bar.
  3. Click to edit model.
  4. Edit model in any matter which will trigger the confirmation page django-admin-confirm features.
  5. Confirm
  6. Note how you are back to the list page but your filters are reset. Specifically note that the url's query parameters are all gone.

Expected behavior
After confirming (step 5), I expect the filters to be preserved. In this case I'd expect the url to be back to /admin/app/model/?foo=bar.

Versions:

  • Firefox 113.0.2
  • Django 4.0.8
  • django-admin-confirm 1.0.0

Additional context
Django has supported preserving filters on the list view since 1.6

ModelAdmin now preserves filters on the list view after creating, editing or deleting an object.
-- https://docs.djangoproject.com/en/dev/releases/1.6/

@TrangPham TrangPham added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants