We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 419f270 commit 7e9cb15Copy full SHA for 7e9cb15
simple_history/utils.py
@@ -112,8 +112,10 @@ def bulk_create_with_history(
112
obj_when_list.append(When(**attributes, then=i))
113
q = Q(**attributes)
114
cumulative_filter = (cumulative_filter | q) if cumulative_filter else q
115
- existing_objs_ids = list(
116
- model_manager.filter(cumulative_filter).values_list("pk", flat=True)
+ existing_objs_ids = (
+ list(model_manager.filter(cumulative_filter).values_list("pk", flat=True))
117
+ if cumulative_filter
118
+ else []
119
)
120
objs_with_id = model_manager.bulk_create(
121
objs, batch_size=batch_size, ignore_conflicts=ignore_conflicts
0 commit comments