Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Uses isinstance method to be more cohesive

  • Loading branch information...
commit 00b48fc2dfec752850ecf24b1f783d2c1a67d7c3 1 parent 6b8f0b6
Bernardo Fontes authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  model_mommy/mommy.py
View
2  model_mommy/mommy.py
@@ -305,7 +305,7 @@ def generate_value(self, field, **fk_attrs):
generator = self.attr_mapping[field.name]
elif getattr(field, 'choices'):
generator = generators.gen_from_choices(field.choices)
- elif isinstance(field, ForeignKey) and field.rel.to is ContentType:
+ elif isinstance(field, ForeignKey) and isinstance(field.rel.to, ContentType):
generator = self.type_mapping[ContentType]
elif field.__class__ in self.type_mapping:
generator = self.type_mapping[field.__class__]
Please sign in to comment.
Something went wrong with that request. Please try again.