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
Fixed #24291 - Fixed migrations with unused swappable models #4071
Conversation
3c13277
to
9e6ec6e
Compare
Flake8 doesn't fail on my local system. Could someone give me any pointers on how to fix it? |
Here you go:
|
I just double-checked and PEP8 allows single lines to separate blocks. Why did flake8 mark that single blank line as an error? Anyway, it works now. |
394ca86
to
5a13791
Compare
buildbot, test this please. |
Could you also make the use of quotes consistent (single quote everywhere should be fine, I think) |
db/migrations/state.py seems to use double quotes almost everywhere, so I used them there as well. tests/migrations/test_state.py was more 50/50 so I switched to consistently using single quotes in the new test. |
buildbot, test this please. |
With this patch Django creates a migrations for |
buildbot, test this please |
""" | ||
Tests making a ProjectState from an Apps with a swappable model | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no blank line needed
You can squash commits, thanks. |
Changed ModelState from_model to use an empty list when an unused swappable model doesn't explicitly define a manager.
Test failure due to failed checkout |
Merged in 15dc8d1. Thanks. |
I slightly changed the test cases to not use an entire |
Changed ModelState from_model to use an empty list if the model was an unused
swappable model.