Browse Source

password as password field in form

Gesche 9 months ago
parent
commit
13c259cc60
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      accounts/views.py

+ 5
- 0
accounts/views.py View File

@@ -16,6 +16,11 @@ class RegisterAccountView(CreateView):
16 16
     fields = ['name', 'password', 'email']
17 17
     template_name = 'register_account.html'
18 18
 
19
+    def get_form(self, form_class=None):
20
+        form = super(RegisterAccountView, self).get_form(form_class)
21
+        form.fields['password'].widget = forms.PasswordInput()
22
+        return form
23
+
19 24
     def form_valid(self, form):
20 25
         self.object = form.save(commit=False)
21 26
 

Loading…
Cancel
Save