Skip to content

Commit

Permalink
add_device_type_components.py: update the cached component counts on …
Browse files Browse the repository at this point in the history
…the Device
  • Loading branch information
candlerb committed Mar 15, 2024
1 parent 647bcf6 commit 906e22f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/add_device_type_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def run(self, data, commit):
if items:
for i in items:
i.full_clean()
klass.objects.bulk_create(items)
# save() also triggers post_save_receiver for TrackingModelMixin
# which updates the counter fields on related objects
i.save()
self.log_success("%s (%d): created %d %s" % (device.name,
device.id,
len(items),
Expand Down

0 comments on commit 906e22f

Please sign in to comment.