diff --git a/jituan/management/commands/backfill_penalty_club_id.py b/jituan/management/commands/backfill_penalty_club_id.py index 6c00ec1..e6f58ef 100644 --- a/jituan/management/commands/backfill_penalty_club_id.py +++ b/jituan/management/commands/backfill_penalty_club_id.py @@ -23,7 +23,7 @@ class Command(BaseCommand): updated = 0 with transaction.atomic(): - for p in qs.iterator(): + for p in qs.to_list(): order = None if p.RelatedOrderID: order = Order.query.filter(OrderID=p.RelatedOrderID).first()