Kaydet (Commit) 43530384 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Fixed #19049 -- Corrected dumb logic negation error from earlier patch.

üst 3b6f980b
......@@ -1026,7 +1026,7 @@ class ForeignKey(RelatedField, Field):
def contribute_to_related_class(self, cls, related):
# Internal FK's - i.e., those with a related name ending with '+' -
# and swapped models don't get a related descriptor.
if not self.rel.is_hidden() and related.model._meta.swapped:
if not self.rel.is_hidden() and not related.model._meta.swapped:
setattr(cls, related.get_accessor_name(), ForeignRelatedObjectsDescriptor(related))
if self.rel.limit_choices_to:
cls._meta.related_fkey_lookups.append(self.rel.limit_choices_to)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment