Skip to content

Commit

Permalink
fix: Use update in migration 0051
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed May 9, 2024
1 parent f5fc1a9 commit c639f95
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cfl_common/common/migrations/0051_verify_returning_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ def verify_returning_users(apps: Apps, *args):
"""
UserProfile = apps.get_model("common", "UserProfile")

unverified_returning_userprofiles = UserProfile.objects.filter(
UserProfile.objects.filter(
user__last_login__isnull=False, is_verified=False
)

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


class Migration(migrations.Migration):
Expand Down

0 comments on commit c639f95

Please sign in to comment.