Skip to content

Commit

Permalink
Save new objects after related objects are created
Browse files Browse the repository at this point in the history
  • Loading branch information
hancush committed Mar 3, 2020
1 parent 195a68c commit d2b768f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pupa/importers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ def import_item(self, data):
self.model_class))
self._create_related(obj, related, self.related_models)

# Save object after related objects are created to allow for
# post-save signals that depend on related objects
obj.save()

if pupa_id:
Identifier.objects.get_or_create(identifier=pupa_id,
jurisdiction_id=self.jurisdiction_id,
Expand Down

0 comments on commit d2b768f

Please sign in to comment.