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
Default format selections on export action #1389
Default format selections on export action #1389
Conversation
Looks good. Thanks for adding this. I think we would add this into our forthcoming v3 release. Please could you add unit tests to prove the contents of the |
ok! I added a unit tests. |
This looks great - thanks for adding the tests. Would you be able to merge the
Thanks so much for adding this. |
I've merged the release-3-x branch into the main branch. |
Thanks @shimakaze-git - I've updated the changelog. I'm going to squash the commits and then merge. |
@matthewhegarty Thanks! |
Problem
#1373
This is the PR for this issue.
When there is only one
formats
like the code below,the format on the Export action does not display---
.By default, you can select the contents specified in formats.
Solution
In the
ExportActionMixin
constructor ofimport_export/admin.py
, if the size offormats
exceeds 1, add---
to choices.Acceptance Criteria
After modifying
CategoryAdmin
intests/core/admin.py
as follows, I confirmed that the format of the Export action in the admin screen is csv.I added a unit tests.