Skip to content

Conversation

@niltonpimentel02
Copy link
Contributor

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

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.48%. Comparing base (7344d60) to head (27cac92).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #741      +/-   ##
==========================================
+ Coverage   78.10%   78.48%   +0.38%     
==========================================
  Files          25       25              
  Lines        1516     1506      -10     
  Branches      238      236       -2     
==========================================
- Hits         1184     1182       -2     
+ Misses        259      252       -7     
+ Partials       73       72       -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
Contributor

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.

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

2 participants