Browse Source

fix(chore): do bulk update instead of single update

Peter Thomassen 7 years ago
parent
commit
635f515661
1 changed files with 1 additions and 3 deletions
  1. 1 3
      api/desecapi/management/commands/privacy-chores.py

+ 1 - 3
api/desecapi/management/commands/privacy-chores.py

@@ -10,6 +10,4 @@ class Command(BaseCommand):
     def handle(self, *args, **kwargs):
 
         users = User.objects.filter(created__lt=timezone.now()-timedelta(hours=settings.ABUSE_BY_REMOTE_IP_PERIOD_HRS))
-        for u in users:
-            u.registration_remote_ip = ''
-            u.save() # TODO bulk update?
+        users.update(registration_remote_ip='')