Skip to content

Commit 0d32dec

Browse files
authored
Use iterator in access token migration (#1522)
1 parent 907d70f commit 0d32dec

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,4 @@ Wouter Klein Heerenbrink
122122
Yaroslav Halchenko
123123
Yuri Savin
124124
Miriam Forner
125+
Alex Kerkum

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
### Fixed
1717
* #1517 OP prompts for logout when no OP session
1818
* #1512 client_secret not marked sensitive
19+
* #1521 Fix 0012 migration loading access token table into memory
1920
<!--
2021
### Security
2122
-->

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)