summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/management/commands/regenerate_search_vector_cached_label.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ishtar_common/management/commands/regenerate_search_vector_cached_label.py b/ishtar_common/management/commands/regenerate_search_vector_cached_label.py
index 542e5f915..8ac0dae03 100644
--- a/ishtar_common/management/commands/regenerate_search_vector_cached_label.py
+++ b/ishtar_common/management/commands/regenerate_search_vector_cached_label.py
@@ -64,13 +64,14 @@ class Command(BaseCommand):
continue
msg = u"-> processing {}: ".format(model._meta.verbose_name)
ln = model.objects.count()
- for idx, object in enumerate(model.objects.all()):
- object.skip_history_when_saving = True
- object._no_move = True
+ for idx, obj_id in enumerate(model.objects.values('id').all()):
+ obj = model.objects.get(pk=obj_id['id'])
+ obj.skip_history_when_saving = True
+ obj._no_move = True
cmsg = u"\r{} {}/{}".format(msg, idx + 1, ln)
if not quiet:
sys.stdout.write(cmsg)
sys.stdout.flush()
- object.save()
+ obj.save()
if not quiet:
sys.stdout.write("\n")