Skip to content

Commit

Permalink
Don't set related object for migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
macro1 committed Oct 11, 2014
1 parent 4463dee commit e129799
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,9 @@ def do_related_class(self, other, cls):
try:
instance_type = cls.instance_type
except AttributeError: # when model is reconstituted for migration
natural_key = "{app}.{model}".format(
app=cls._meta.app_label,
model=cls.__name__[10:],
)
instance_type = cls._meta.apps.get_model(natural_key)
self.related = RelatedObject(other, instance_type, self)
pass
else:
self.related = RelatedObject(other, instance_type, self)
transform_field(field)
field.rel = None

Expand Down

0 comments on commit e129799

Please sign in to comment.