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 #26710 -- Made CreateModel.references_model take app_label into account. #6728

Closed

Conversation

sir-sigurd
Copy link
Member

@@ -104,20 +104,25 @@ def describe(self):
return "Create %smodel %s" % ("proxy " if self.options.get("proxy", False) else "", self.name)

def references_model(self, name, app_label=None):
strings_to_check = [self.name]
name_lower = name.lower()
if name_lower == self.name_lower:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this also take into account app_label?

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems that this couldn't be done with the current approach.
I think that we could add current_app argument to references_model and references_field to handle it, but probable this should go to another PR.

Copy link
Member

Choose a reason for hiding this comment

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

Does if app_label is None and name_lower == self.name_lower breaks any tests?

Copy link
Member Author

@sir-sigurd sir-sigurd Jun 6, 2016

Choose a reason for hiding this comment

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

Yes, it breaks some tests.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, let's keep this change for another PR then.

@sir-sigurd sir-sigurd force-pushed the create-model-references-model branch from 55aa1fe to 674d02b Compare June 6, 2016 07:12
@timgraham
Copy link
Member

merged in 7fc4c1d, thanks!

@timgraham timgraham closed this Jun 6, 2016
@sir-sigurd sir-sigurd deleted the create-model-references-model branch June 17, 2016 09:18
@millin
Copy link

millin commented Sep 19, 2016

@timgraham, could you apply it to stable?

@timgraham
Copy link
Member

If it's not a regression from a previous release or a major bug in a new feature it won't be backported. See our supported versions policy.

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