diff --git a/scripts/add_device_type_components.py b/scripts/add_device_type_components.py index ccb3419..ea516b9 100644 --- a/scripts/add_device_type_components.py +++ b/scripts/add_device_type_components.py @@ -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),