Skip to content

Commit 8fce755

Browse files
Fabio Souzajeking3
authored andcommitted
Replaces count by exists in populate_history command
1 parent 720fd8a commit 8fce755

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simple_history/management/commands/populate_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _bulk_history_create(self, model, batch_size):
156156

157157
def _process(self, to_process, batch_size):
158158
for model, history_model in to_process:
159-
if history_model.objects.count():
159+
if history_model.objects.exists():
160160
self.stderr.write(
161161
"{msg} {model}\n".format(
162162
msg=self.EXISTING_HISTORY_FOUND, model=model

0 commit comments

Comments
 (0)