File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
from django import forms
2
2
from .models import User
3
- from django .contrib .auth .forms import UserCreationForm
3
+ from django .contrib .auth .forms import UserCreationForm , PasswordChangeForm
4
4
5
5
6
6
class UserRegisterForm (UserCreationForm ):
@@ -25,3 +25,9 @@ class UserUpdateForm(forms.ModelForm):
25
25
class Meta :
26
26
model = User
27
27
fields = ["username" , "default_api" ]
28
+
29
+
30
+ class PasswordChangeForm (PasswordChangeForm ):
31
+ def __init__ (self , * args , ** kwargs ):
32
+ super ().__init__ (* args , ** kwargs )
33
+ self .fields ['old_password' ].widget .attrs .pop ("autofocus" , None )
Original file line number Diff line number Diff line change 5
5
authenticate ,
6
6
login as auth_login ,
7
7
)
8
- from django .contrib .auth .forms import PasswordChangeForm , AuthenticationForm
8
+ from django .contrib .auth .forms import AuthenticationForm
9
9
from django .contrib .auth .decorators import login_required
10
10
from django .utils .http import url_has_allowed_host_and_scheme
11
11
from django .http import JsonResponse
14
14
15
15
16
16
from app .models import Media , Season
17
- from app .forms import UserRegisterForm , UserUpdateForm
17
+ from app .forms import UserRegisterForm , UserUpdateForm , PasswordChangeForm
18
18
from app .utils import database , interactions , imports
19
19
20
20
You can’t perform that action at this time.
0 commit comments