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 #27709 -- Fixed get_for_models() for proxies with an empty cache. #7842

Merged

Conversation

charettes
Copy link
Member

Thanks Peter Inglesby for the report and tests.

@charettes charettes force-pushed the ticket-27709-proxy-model-contenttypes-cache branch from 316cb79 to 0a6863e Compare January 13, 2017 02:14
@timgraham
Copy link
Member

Do you think the code is clear enough without any additional comments?

@charettes
Copy link
Member Author

@timgraham I do now that I've spent some time dealing with it but given this issue was in there for so long some extra comments wouldn't hurt.

@charettes charettes force-pushed the ticket-27709-proxy-model-contenttypes-cache branch from 0a6863e to 06fd910 Compare January 13, 2017 14:26
@charettes
Copy link
Member Author

Adding comments made me realize the code had a bug with contenttypes creation. I added an test and fix the issue so I'll proceed with merge once the build goes green.

@charettes charettes force-pushed the ticket-27709-proxy-model-contenttypes-cache branch from 06fd910 to 499940b Compare January 13, 2017 14:28
self._add_to_cache(self.db, ct)
for opts in needed_opts:
# These weren't in the cache, or the DB, create them.
# These weren't in the cache, or the DB, create them.
Copy link
Member

Choose a reason for hiding this comment

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

You could rewrite this as: "Create content types that weren't in the cache or DB."

Thanks Peter Inglesby for the report and tests.
@charettes charettes force-pushed the ticket-27709-proxy-model-contenttypes-cache branch from 499940b to 4e48cfc Compare January 13, 2017 15:02
@charettes charettes merged commit 4e48cfc into django:master Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants