Skip to content

Conversation

@niltonpimentel02
Copy link
Contributor

@niltonpimentel02 niltonpimentel02 commented Dec 18, 2025

Context

  • I was able to reproduce the bug, and after removing the legacy code, the filters are working correctly again.
  • It took me a while to understand how the admin tests are structured since I’m not very familiar with them.
  • Once I figured that out, I added a test to ensure the behavior is now correct.
  • I also tested it manually by creating a local project and installing the package with the updated code.

Additional Comments

If I’m missing anything or overlooking some edge case, please let me know. I'm also open to any ideas or tips regarding the code!

Thanks, everyone 😄

Related Issue

Closes #356
Closes #125

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.98%. Comparing base (7e9c20f) to head (109a264).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #741      +/-   ##
==========================================
+ Coverage   83.40%   83.98%   +0.57%     
==========================================
  Files          27       27              
  Lines        1621     1611      -10     
  Branches      255      253       -2     
==========================================
+ Hits         1352     1353       +1     
+ Misses        206      196      -10     
+ Partials       63       62       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bckohan
Copy link
Collaborator

bckohan commented Dec 18, 2025

Thanks for this @niltonpimentel02!

I added a few comments - This issue also relates to #125. I'd like this PR to close that one as well. My initial attempt at reproducing #125 wasn't successful. They're claiming a redirect after a save or update is redirecting from a url that has the derived class model type in it to a url that has the base class model type in it. I couldn't figure out how to navigate the admin pages to trigger that... but I do suspect this might partly be why the get_preserved_filters method was overriden in #121

@niltonpimentel02
Copy link
Contributor Author

niltonpimentel02 commented Dec 18, 2025

Thanks for this @niltonpimentel02!

I added a few comments - This issue also relates to #125. I'd like this PR to close that one as well. My initial attempt at reproducing #125 wasn't successful. They're claiming a redirect after a save or update is redirecting from a url that has the derived class model type in it to a url that has the base class model type in it. I couldn't figure out how to navigate the admin pages to trigger that... but I do suspect this might partly be why the get_preserved_filters method was overriden in #121

Hey! I forgot to mention that for my tests here, I installed Django==4.2.27 and confirmed that removing the code, the filters worked as expected.

It would be nice to close both issues, but if we can't reproduce the error from issue 125, it's going to be tricky to resolve, as I managed to reproduce issue 356 here.

Copy link
Collaborator

@bckohan bckohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @niltonpimentel02! I did verify that this also fixes #125

@bckohan bckohan merged commit 06729c3 into jazzband:master Jan 6, 2026
44 checks passed
@niltonpimentel02 niltonpimentel02 deleted the 356 branch January 6, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filters are not preserved in polymorphic parent admin Admin change form doesn't preserve changelist filter

2 participants