File tree Expand file tree Collapse file tree 3 files changed +4
-1
lines changed Expand file tree Collapse file tree 3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ Julien Palard
7575Jun Zhou
7676Kaleb Porter
7777Kristian Rune Larsen
78+ Lazaros Toumanidis
7879Ludwig Hähne
7980Łukasz Skarżyński
8081Marcus Sonestedt
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636* #1336 Fix encapsulation for Redirect URI scheme validation
3737* #1357 Move import of setting_changed signal from test to django core modules
3838* #1268 fix prompt=none redirects to login screen
39+ * #1381 fix AttributeError in OAuth2ExtraTokenMiddleware when a custom AccessToken model is used
3940
4041### Removed
4142* #1350 Remove support for Python 3.7 and Django 2.2
Original file line number Diff line number Diff line change 33from django .contrib .auth import authenticate
44from django .utils .cache import patch_vary_headers
55
6- from oauth2_provider .models import AccessToken
6+ from oauth2_provider .models import get_access_token_model
77
88
99log = logging .getLogger (__name__ )
@@ -53,6 +53,7 @@ def __call__(self, request):
5353 authheader = request .META .get ("HTTP_AUTHORIZATION" , "" )
5454 if authheader .startswith ("Bearer" ):
5555 tokenstring = authheader .split ()[1 ]
56+ AccessToken = get_access_token_model ()
5657 try :
5758 token = AccessToken .objects .get (token = tokenstring )
5859 request .access_token = token
You can’t perform that action at this time.
0 commit comments