diff options
| -rw-r--r-- | ishtar_common/management/commands/process_pending_update.py | 11 | 
1 files changed, 5 insertions, 6 deletions
| diff --git a/ishtar_common/management/commands/process_pending_update.py b/ishtar_common/management/commands/process_pending_update.py index f0e908d42..6e97847cc 100644 --- a/ishtar_common/management/commands/process_pending_update.py +++ b/ishtar_common/management/commands/process_pending_update.py @@ -48,13 +48,12 @@ class Command(BaseCommand):                      continue                  if not bool(                          [True for k in model._meta.get_fields() -                         if k == "need_update"]): +                         if k.name == "need_update"]):                      continue                  msg = u"-> processing {}: ".format(model._meta.verbose_name) -                ln = model.objects.count() -                for idx, obj_id in enumerate( -                        model.objects.filter( -                            need_update=True).values('pk').all()): +                q = model.objects.filter(need_update=True) +                ln = q.count() +                for idx, obj_id in enumerate(q.values('pk').all()):                      obj = model.objects.get(pk=obj_id['pk'])                      obj.skip_history_when_saving = True                      obj._no_move = True @@ -63,5 +62,5 @@ class Command(BaseCommand):                          sys.stdout.write(cmsg)                          sys.stdout.flush()                      obj.save() -                if not quiet: +                if not quiet and ln:                      sys.stdout.write("\n") | 
