Skip to content

Commit

Permalink
Use iterator in access token migration (#1522)
Browse files Browse the repository at this point in the history
  • Loading branch information
acidtv authored Nov 4, 2024
1 parent 907d70f commit 0d32dec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@ Wouter Klein Heerenbrink
Yaroslav Halchenko
Yuri Savin
Miriam Forner
Alex Kerkum
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
* #1517 OP prompts for logout when no OP session
* #1512 client_secret not marked sensitive
* #1521 Fix 0012 migration loading access token table into memory
<!--
### Security
-->
Expand Down
2 changes: 1 addition & 1 deletion oauth2_provider/migrations/0012_add_token_checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def forwards_func(apps, schema_editor):
Forward migration touches every "old" accesstoken.token which will cause the checksum to be computed.
"""
AccessToken = apps.get_model(oauth2_settings.ACCESS_TOKEN_MODEL)
accesstokens = AccessToken._default_manager.all()
accesstokens = AccessToken._default_manager.iterator()
for accesstoken in accesstokens:
accesstoken.save(update_fields=['token_checksum'])

Expand Down

0 comments on commit 0d32dec

Please sign in to comment.