File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 8
8
from django .utils .http import base36_to_int as uid_decoder
9
9
from django .contrib .auth .tokens import default_token_generator
10
10
from django .utils .translation import ugettext_lazy as _
11
+ from django import VERSION
11
12
12
13
from rest_framework import serializers , exceptions
13
14
from rest_framework .authtoken .models import Token
14
15
from rest_framework .exceptions import ValidationError
15
- from django .contrib .auth import update_session_auth_hash
16
16
17
17
18
18
class LoginSerializer (serializers .Serializer ):
@@ -216,5 +216,6 @@ def validate(self, attrs):
216
216
217
217
def save (self ):
218
218
self .set_password_form .save ()
219
- if not self .logout_on_password_change :
219
+ if VERSION [1 ] > 6 and not self .logout_on_password_change :
220
+ from django .contrib .auth import update_session_auth_hash
220
221
update_session_auth_hash (self .request , self .user )
You can’t perform that action at this time.
0 commit comments