Skip to content

Commit

Permalink
fix: Add iterator to migration 0051
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed May 8, 2024
1 parent dac1eb0 commit c2f7fa0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cfl_common/common/migrations/0051_verify_returning_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def verify_returning_users(apps: Apps, *args):
user__last_login__isnull=False, is_verified=False
)

for unverified_returning_userprofile in unverified_returning_userprofiles:
for (
unverified_returning_userprofile
) in unverified_returning_userprofiles.iterator(chunk_size=1000):
unverified_returning_userprofile.is_verified = True
unverified_returning_userprofile.save()

Expand Down

0 comments on commit c2f7fa0

Please sign in to comment.