password as password field in form

This commit is contained in:
Gesche 2019-02-10 14:17:26 +01:00
parent 84fc9f9570
commit 13c259cc60
1 changed files with 5 additions and 0 deletions

View File

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