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

Fixed #24291 - Fixed migrations with unused swappable models #4071

Closed
wants to merge 1 commit into from

Conversation

knbk
Copy link
Contributor

@knbk knbk commented Feb 6, 2015

Changed ModelState from_model to use an empty list if the model was an unused
swappable model.

@knbk knbk force-pushed the ticket_24291 branch 4 times, most recently from 3c13277 to 9e6ec6e Compare February 6, 2015 15:04
@knbk
Copy link
Contributor Author

knbk commented Feb 6, 2015

Flake8 doesn't fail on my local system. Could someone give me any pointers on how to fix it?

@MarkusH
Copy link
Member

MarkusH commented Feb 6, 2015

Here you go:

./tests/migrations/test_state.py:568:9: E303 too many blank lines (2)

@knbk
Copy link
Contributor Author

knbk commented Feb 6, 2015

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.

@knbk knbk force-pushed the ticket_24291 branch 5 times, most recently from 394ca86 to 5a13791 Compare February 15, 2015 13:57
@MarkusH
Copy link
Member

MarkusH commented Feb 15, 2015

buildbot, test this please.

@timgraham
Copy link
Member

Could you also make the use of quotes consistent (single quote everywhere should be fine, I think)

@knbk
Copy link
Contributor Author

knbk commented Feb 16, 2015

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.

@MarkusH
Copy link
Member

MarkusH commented Feb 17, 2015

buildbot, test this please.

@MarkusH
Copy link
Member

MarkusH commented Feb 17, 2015

With this patch Django creates a migrations for auth that drops the managers from User and Permission when I have a project with AUTH_USER_MODEL = 'myapp.MyUser'

@collinanderson
Copy link
Contributor

buildbot, test this please

"""
Tests making a ProjectState from an Apps with a swappable model
"""

Copy link
Member

Choose a reason for hiding this comment

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

no blank line needed

@timgraham
Copy link
Member

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.
@MarkusH
Copy link
Member

MarkusH commented Feb 18, 2015

Test failure due to failed checkout

@MarkusH
Copy link
Member

MarkusH commented Feb 18, 2015

Merged in 15dc8d1. Thanks.

@MarkusH MarkusH closed this Feb 18, 2015
@MarkusH
Copy link
Member

MarkusH commented Feb 18, 2015

I slightly changed the test cases to not use an entire ProjectState but just ModelState.from_model() and thus moved them into ModelStateTests.

@knbk knbk deleted the ticket_24291 branch February 24, 2015 17:15
@knbk knbk restored the ticket_24291 branch February 24, 2015 17:16
@knbk knbk deleted the ticket_24291 branch November 12, 2016 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants