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 #35408 -- Optimized post-migrate permission creation. #18105

Merged
merged 1 commit into from May 13, 2024

Conversation

adamchainz
Copy link
Sponsor Member

Trac ticket number

ticket-35408

Branch description

See ticket.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

@adamchainz adamchainz force-pushed the ticket_35408 branch 2 times, most recently from 2fda5fa to ba10093 Compare April 26, 2024 11:07
Comment on lines +49 to +54
try:
Permission = apps.get_model("auth", "Permission")
except LookupError:
return
if not router.allow_migrate_model(using, Permission):
return
Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Moved up here to early return before the extra call to create_contenttypes

@adamchainz adamchainz force-pushed the ticket_35408 branch 2 times, most recently from 4bf2c75 to 8b34ffa Compare May 3, 2024 20:22
co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
@adamchainz
Copy link
Sponsor Member Author

Just pushed a fix because I realized I hadn’t actually removed the second allow_migrate_model() call as noted in #18105 (comment) . Fixed now.

@sarahboyce sarahboyce merged commit d2c5a30 into django:main May 13, 2024
33 checks passed
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