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

Admin: add view popup breaks if initial submit has validation error #612

Open
pannkotsky opened this issue Jul 23, 2024 · 0 comments
Open

Comments

@pannkotsky
Copy link

Scenario:

  • in Django admin click green + next to the foreign key field that opens PolymorphicParentModelAdmin add view
  • Submit form with validation error
  • Fix the error and submit again

Expected:

  • object is added, popup is closed, object is populated to the foreign key field widget on the original form

Actual:

  • popup is not closed, field widget is not populated

This happens because after initial submit with validation error the query params indicating popup are removed, and only ct_id param is preserved. It comes from the following lines of code: https://github.com/jazzband/django-polymorphic/blob/master/polymorphic/admin/parentadmin.py#L202-L208

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

No branches or pull requests

1 participant