Skip to content

Commit 04af386

Browse files
committed
Use iterator in access token migration
1 parent 907d70f commit 04af386

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oauth2_provider/migrations/0012_add_token_checksum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def forwards_func(apps, schema_editor):
99
Forward migration touches every "old" accesstoken.token which will cause the checksum to be computed.
1010
"""
1111
AccessToken = apps.get_model(oauth2_settings.ACCESS_TOKEN_MODEL)
12-
accesstokens = AccessToken._default_manager.all()
12+
accesstokens = AccessToken._default_manager.iterator()
1313
for accesstoken in accesstokens:
1414
accesstoken.save(update_fields=['token_checksum'])
1515

0 commit comments

Comments
 (0)