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
Conversation
@@ -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: |
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.
Shouldn't this also take into account app_label
?
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.
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.
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.
Does if app_label is None and name_lower == self.name_lower
breaks any tests?
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.
Yes, it breaks some tests.
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.
Alright, let's keep this change for another PR then.
55aa1fe
to
674d02b
Compare
merged in 7fc4c1d, thanks! |
@timgraham, could you apply it to stable? |
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. |
https://code.djangoproject.com/ticket/26710