Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 19, 2022
1 parent bc87a57 commit c3a01d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions simple_history/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ def bulk_create_with_history(
obj_when_list.append(When(**attributes, then=i))
q = Q(**attributes)
cumulative_filter = (cumulative_filter | q) if cumulative_filter else q
existing_objs_ids = list(
model_manager.filter(cumulative_filter).values_list("pk", flat=True)
) if cumulative_filter else []
existing_objs_ids = (
list(model_manager.filter(cumulative_filter).values_list("pk", flat=True))
if cumulative_filter
else []
)
objs_with_id = model_manager.bulk_create(
objs, batch_size=batch_size, ignore_conflicts=ignore_conflicts
)
Expand Down

0 comments on commit c3a01d4

Please sign in to comment.